Skip to content

Commit

Permalink
Revert "Remove GZ_SINGLETON_DECLARE definition workaround (fix for ar…
Browse files Browse the repository at this point in the history
…mhf)"

This reverts commit e65ed2e.

Signed-off-by: Steve Peters <[email protected]>
  • Loading branch information
scpeters committed Dec 3, 2024
1 parent bae98f7 commit 075a17c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions gazebo/common/SingletonT.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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<n1::n2::singletonType>;
#endif

/// \}

#endif

0 comments on commit 075a17c

Please sign in to comment.