From b483804b0f7777046fc198793f4037b9a9cb080d Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 23 Nov 2016 18:15:51 +0100 Subject: Change order of template instantiations for clang At least Apple's clang-703.0.31 needs this. --- include/astra/Singleton.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/astra/Singleton.h b/include/astra/Singleton.h index 9d3c088..7271691 100644 --- a/include/astra/Singleton.h +++ b/include/astra/Singleton.h @@ -82,15 +82,15 @@ class Singleton { // libastra. This situation would cause issues when .mex files are unloaded. #define DEFINE_SINGLETON(T) \ -template<> void Singleton::construct() { assert(!m_singleton); m_singleton = new T(); } \ -template<> T* Singleton::m_singleton = 0 +template<> T* Singleton::m_singleton = 0; \ +template<> void Singleton::construct() { assert(!m_singleton); m_singleton = new T(); } // This is a hack to support statements like // DEFINE_SINGLETON2(CTemplatedClass); #define DEFINE_SINGLETON2(A,B) \ -template<> void Singleton::construct() { assert(!m_singleton); m_singleton = new A,B(); } \ -template<> A,B* Singleton::m_singleton = 0 +template<> A,B* Singleton::m_singleton = 0; \ +template<> void Singleton::construct() { assert(!m_singleton); m_singleton = new A,B(); } } // end namespace -- cgit v1.2.3