summaryrefslogtreecommitdiff
path: root/include/util
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2012-09-06 10:25:57 +0200
committerAndreas Baumann <abaumann@yahoo.com>2012-09-06 10:25:57 +0200
commitf5c586f7231f7e033c5528bcefea357e4e64441c (patch)
tree4d039e54c77bdb84a1cb79b56db7b62bccdd43d8 /include/util
parenta29c464aa72d46cc956ac2752a2518526c499716 (diff)
downloadcrawler-f5c586f7231f7e033c5528bcefea357e4e64441c.tar.gz
crawler-f5c586f7231f7e033c5528bcefea357e4e64441c.tar.bz2
first properly working logger on Windows (singleton dll issue)
Diffstat (limited to 'include/util')
-rwxr-xr-xinclude/util/Exportable.hpp23
-rwxr-xr-xinclude/util/NonCopyable.hpp2
-rwxr-xr-xinclude/util/ScopedPtr.hpp2
-rwxr-xr-xinclude/util/Singleton.hpp14
4 files changed, 24 insertions, 17 deletions
diff --git a/include/util/Exportable.hpp b/include/util/Exportable.hpp
index a676ae3..fc8269f 100755
--- a/include/util/Exportable.hpp
+++ b/include/util/Exportable.hpp
@@ -3,21 +3,22 @@
#ifndef _WIN32
-#define SINGLETON_EXPORT
-#define SINGLETON_EXTERN
-
-#define DLL_EXPORT
+#define DLL_VISIBLE
+#define DLL_EXTERN
#else
-#define DLL_EXPORT __declspec(dllexport)
-
-#ifndef SHARED
-#define SINGLETON_EXPORT __declspec(dllexport)
-#define SINGLETON_EXTERN
+#ifdef NODLL
+#define DLL_VISIBLE
+#define DLL_EXTERN
#else
-#define SINGLETON_EXPORT __declspec(dllimport)
-#define SINGLETON_EXTERN extern
+#ifdef SHARED
+#define DLL_VISIBLE __declspec(dllexport)
+#define DLL_EXTERN
+#else
+#define DLL_VISIBLE __declspec(dllimport)
+#define DLL_EXTERN
+#endif
#endif
#endif // _WIN32
diff --git a/include/util/NonCopyable.hpp b/include/util/NonCopyable.hpp
index 44d1a93..99804d2 100755
--- a/include/util/NonCopyable.hpp
+++ b/include/util/NonCopyable.hpp
@@ -6,7 +6,7 @@
namespace __dont_touch
{
-class SINGLETON_EXPORT noncopyable
+class DLL_VISIBLE noncopyable
{
protected:
noncopyable( ) { }
diff --git a/include/util/ScopedPtr.hpp b/include/util/ScopedPtr.hpp
index 19a41d2..991409d 100755
--- a/include/util/ScopedPtr.hpp
+++ b/include/util/ScopedPtr.hpp
@@ -4,7 +4,7 @@
#include "NonCopyable.hpp"
template< typename T >
-class scopedPtr : private noncopyable
+class DLL_VISIBLE scopedPtr : private noncopyable
{
public:
explicit scopedPtr( T *p = 0 ) : m_p( p ) { }
diff --git a/include/util/Singleton.hpp b/include/util/Singleton.hpp
index 1bfb460..f291435 100755
--- a/include/util/Singleton.hpp
+++ b/include/util/Singleton.hpp
@@ -10,17 +10,23 @@
#include <stdexcept>
#define DECLARE_SINGLETON( T ) \
- friend class scopedPtr< T >; \
- friend class Singleton< T >;
+ friend class Singleton< T >; \
+ friend class scopedPtr< T >;
+
+#define DEFINE_SINGLETON( T )
+
+#if 0
+#define DECLARE_SINGLETON( T ) \
#define DEFINE_SINGLETON( T ) \
- SINGLETON_EXTERN template class SINGLETON_EXPORT Singleton< T >;
+ DLL_EXTERN template class DLL_VISIBLE Singleton< T >;
+#endif
template< class T >
class Singleton : private noncopyable
{
public:
- static T& instance( )
+ DLL_VISIBLE static T& instance( )
{
if( destroyed ) {
onDeadReference( );