From f6939dfbdd979dfbb749c64703d0cdc53dae106d Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Fri, 7 Sep 2012 10:31:27 +0200 Subject: fixed miracle of unresolved instance function in Singleton (we need a "usage" of the template somewhere in the DLL) fixed all module tests on Windows --- include/logger/Logger.hpp | 2 ++ include/util/Singleton.hpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/logger/Logger.hpp b/include/logger/Logger.hpp index 451ca45..d7603ab 100755 --- a/include/logger/Logger.hpp +++ b/include/logger/Logger.hpp @@ -50,6 +50,8 @@ class Logger : public Singleton< Logger > scopedPtr< LoggerImpl > m_impl; }; +DEFINE_SINGLETON( Logger ) + class LogStream : private noncopyable, public std::ostringstream { public: diff --git a/include/util/Singleton.hpp b/include/util/Singleton.hpp index 80ab5e8..de43dbe 100755 --- a/include/util/Singleton.hpp +++ b/include/util/Singleton.hpp @@ -12,12 +12,15 @@ #define DECLARE_SINGLETON( T ) \ friend class Singleton< T >; \ friend class scopedPtr< T >; + +#define DEFINE_SINGLETON( T ) \ + template class Singleton< T >; template< class T > class Singleton : private noncopyable { public: - UTIL_DLL_VISIBLE static T& instance( ) + static UTIL_DLL_VISIBLE T& instance( ) { if( destroyed ) { onDeadReference( ); -- cgit v1.2.3-54-g00ecf