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)" (#3412)

This reverts commit e65ed2e.
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
scpeters authored Dec 3, 2024
1 parent bae98f7 commit 85f2790
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 85f2790

Please sign in to comment.