From cea752e18f8c85c81bda464bdacec70ccc32511b Mon Sep 17 00:00:00 2001 From: Dimitry Ishenko Date: Thu, 19 Sep 2024 18:48:04 -0400 Subject: [PATCH] chore: nested namespace declarations are part of C++17 --- src/accelerator/StdAfx.h | 1 - src/common/CMakeLists.txt | 1 - src/common/forward.h | 15 -------- src/core/StdAfx.h | 1 - src/core/consumer/output.h | 4 +-- src/core/fwd.h | 46 ++++++++++++------------ src/core/mixer/audio/audio_mixer.h | 3 +- src/core/mixer/mixer.h | 5 ++- src/core/producer/stage.h | 3 +- src/protocol/amcp/amcp_command_context.h | 3 +- 10 files changed, 28 insertions(+), 54 deletions(-) delete mode 100644 src/common/forward.h diff --git a/src/accelerator/StdAfx.h b/src/accelerator/StdAfx.h index fbb03b8887..928527e013 100644 --- a/src/accelerator/StdAfx.h +++ b/src/accelerator/StdAfx.h @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index c53bf3b6a8..39eb8e64ac 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -46,7 +46,6 @@ set(HEADERS executor.h except.h filesystem.h - forward.h future.h log.h memory.h diff --git a/src/common/forward.h b/src/common/forward.h deleted file mode 100644 index 46fc54da15..0000000000 --- a/src/common/forward.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#define FORWARD0(expr) expr -#define FORWARD1(a1, expr) \ - namespace a1 { \ - expr; \ - } -#define FORWARD2(a1, a2, expr) \ - namespace a1 { namespace a2 { \ - expr; \ - }} -#define FORWARD3(a1, a2, a3, expr) \ - namespace a1 { namespace a2 { namespace a3 { \ - expr; \ - }}} diff --git a/src/core/StdAfx.h b/src/core/StdAfx.h index 14eeae0e08..d0d09c753e 100644 --- a/src/core/StdAfx.h +++ b/src/core/StdAfx.h @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include diff --git a/src/core/consumer/output.h b/src/core/consumer/output.h index 5eca6b61a9..6be058486e 100644 --- a/src/core/consumer/output.h +++ b/src/core/consumer/output.h @@ -24,14 +24,12 @@ #include "../fwd.h" #include "../monitor/monitor.h" -#include #include - #include #include -FORWARD2(caspar, diagnostics, class graph); +namespace caspar::diagnostics { class graph; } namespace caspar { namespace core { diff --git a/src/core/fwd.h b/src/core/fwd.h index d61d1f070e..1b00b57d30 100644 --- a/src/core/fwd.h +++ b/src/core/fwd.h @@ -20,28 +20,26 @@ */ #pragma once -#include +namespace caspar::accelerator { class accelerator; } +namespace caspar::accelerator::ogl { class device; } -FORWARD2(caspar, accelerator, class accelerator); -FORWARD3(caspar, accelerator, ogl, class device); - -FORWARD2(caspar, core, class stage); -FORWARD2(caspar, core, class mixer); -FORWARD2(caspar, core, class output); -FORWARD2(caspar, core, class image_mixer); -FORWARD2(caspar, core, struct video_format_desc); -FORWARD2(caspar, core, class frame_factory); -FORWARD2(caspar, core, class frame_producer); -FORWARD2(caspar, core, class frame_consumer); -FORWARD2(caspar, core, class draw_frame); -FORWARD2(caspar, core, class mutable_frame); -FORWARD2(caspar, core, class const_frame); -FORWARD2(caspar, core, class video_channel); -FORWARD2(caspar, core, struct pixel_format_desc); -FORWARD2(caspar, core, class cg_producer_registry); -FORWARD2(caspar, core, struct frame_transform); -FORWARD2(caspar, core, struct write_frame_consumer); -FORWARD2(caspar, core, struct frame_producer_dependencies); -FORWARD2(caspar, core, struct module_dependencies); -FORWARD2(caspar, core, class frame_producer_registry); -FORWARD2(caspar, core, class video_format_repository); +namespace caspar::core { class stage; } +namespace caspar::core { class mixer; } +namespace caspar::core { class output; } +namespace caspar::core { class image_mixer; } +namespace caspar::core { struct video_format_desc; } +namespace caspar::core { class frame_factory; } +namespace caspar::core { class frame_producer; } +namespace caspar::core { class frame_consumer; } +namespace caspar::core { class draw_frame; } +namespace caspar::core { class mutable_frame; } +namespace caspar::core { class const_frame; } +namespace caspar::core { class video_channel; } +namespace caspar::core { struct pixel_format_desc; } +namespace caspar::core { class cg_producer_registry; } +namespace caspar::core { struct frame_transform; } +namespace caspar::core { struct write_frame_consumer; } +namespace caspar::core { struct frame_producer_dependencies; } +namespace caspar::core { struct module_dependencies; } +namespace caspar::core { class frame_producer_registry; } +namespace caspar::core { class video_format_repository; } diff --git a/src/core/mixer/audio/audio_mixer.h b/src/core/mixer/audio/audio_mixer.h index b71e36c062..785139fe61 100644 --- a/src/core/mixer/audio/audio_mixer.h +++ b/src/core/mixer/audio/audio_mixer.h @@ -22,7 +22,6 @@ #pragma once #include -#include #include #include @@ -31,7 +30,7 @@ #include -FORWARD2(caspar, diagnostics, class graph); +namespace caspar::diagnostics { class graph; } namespace caspar { namespace core { diff --git a/src/core/mixer/mixer.h b/src/core/mixer/mixer.h index 2473c0ead1..252d80c2fd 100644 --- a/src/core/mixer/mixer.h +++ b/src/core/mixer/mixer.h @@ -22,13 +22,12 @@ #pragma once #include -#include #include #include #include -FORWARD2(caspar, diagnostics, class graph); +namespace caspar::diagnostics { class graph; } namespace caspar { namespace core { @@ -58,4 +57,4 @@ class mixer final spl::shared_ptr impl_; }; -}} // namespace caspar::core \ No newline at end of file +}} // namespace caspar::core diff --git a/src/core/producer/stage.h b/src/core/producer/stage.h index f83a4f5dc7..1081a8e104 100644 --- a/src/core/producer/stage.h +++ b/src/core/producer/stage.h @@ -25,7 +25,6 @@ #include "../monitor/monitor.h" #include -#include #include #include @@ -39,7 +38,7 @@ #include #include -FORWARD2(caspar, diagnostics, class graph); +namespace caspar::diagnostics { class graph; } namespace caspar { namespace core { diff --git a/src/protocol/amcp/amcp_command_context.h b/src/protocol/amcp/amcp_command_context.h index 0a4c331ab3..7f357af013 100644 --- a/src/protocol/amcp/amcp_command_context.h +++ b/src/protocol/amcp/amcp_command_context.h @@ -25,12 +25,11 @@ #include "amcp_command_repository.h" #include "amcp_shared.h" #include -#include #include #include #include -FORWARD3(caspar, protocol, osc, class client); +namespace caspar::protocol::osc { class client; } namespace caspar { namespace protocol { namespace amcp {