From 075a17cc5795d891f4118a4e2157467f8f8ab80a Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Mon, 2 Dec 2024 22:29:10 -0800 Subject: [PATCH] Revert "Remove GZ_SINGLETON_DECLARE definition workaround (fix for armhf)" This reverts commit e65ed2ea5c24b99caf78da93e5a70d793dba01d8. Signed-off-by: Steve Peters --- gazebo/common/SingletonT.hh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gazebo/common/SingletonT.hh b/gazebo/common/SingletonT.hh index 9d550eaa9e..e0b9cb967e 100644 --- a/gazebo/common/SingletonT.hh +++ b/gazebo/common/SingletonT.hh @@ -69,5 +69,23 @@ class SingletonT } }; +/// \brief Helper to declare typed SingletonT +// clang doesn't compile if it explicitly specializes a type before +// the type is defined. (forward declaration is not enough.) +#ifdef __clang__ #define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType) +#else +#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType) \ +namespace n1 \ +{ \ + namespace n2 \ + { \ + class singletonType; \ + } \ +} \ +template class visibility ::SingletonT; +#endif + +/// \} + #endif