summaryrefslogtreecommitdiff
path: root/include/util
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2012-09-06 22:18:23 +0200
committerAndreas Baumann <abaumann@yahoo.com>2012-09-06 22:18:23 +0200
commit13fc9a7da5111f4ddba942d3c6b6b8654ce395d6 (patch)
treee86210e3d939911e35f930a6dc73c3ebb591243b /include/util
parentf5c586f7231f7e033c5528bcefea357e4e64441c (diff)
downloadcrawler-13fc9a7da5111f4ddba942d3c6b6b8654ce395d6.tar.gz
crawler-13fc9a7da5111f4ddba942d3c6b6b8654ce395d6.tar.bz2
more splitting into libcrawl, crawl binary
moved more public header to 'include' changed approach for dynamic linking on Windows
Diffstat (limited to 'include/util')
-rwxr-xr-xinclude/util/Exportable.hpp26
-rwxr-xr-xinclude/util/NonCopyable.hpp4
-rwxr-xr-xinclude/util/ScopedPtr.hpp3
-rwxr-xr-xinclude/util/Singleton.hpp13
-rwxr-xr-xinclude/util/UtilExportable.hpp26
5 files changed, 32 insertions, 40 deletions
diff --git a/include/util/Exportable.hpp b/include/util/Exportable.hpp
deleted file mode 100755
index fc8269f..0000000
--- a/include/util/Exportable.hpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef __EXPORTABLE_H
-#define __EXPORTABLE_H
-
-#ifndef _WIN32
-
-#define DLL_VISIBLE
-#define DLL_EXTERN
-
-#else
-
-#ifdef NODLL
-#define DLL_VISIBLE
-#define DLL_EXTERN
-#else
-#ifdef SHARED
-#define DLL_VISIBLE __declspec(dllexport)
-#define DLL_EXTERN
-#else
-#define DLL_VISIBLE __declspec(dllimport)
-#define DLL_EXTERN
-#endif
-#endif
-
-#endif // _WIN32
-
-#endif
diff --git a/include/util/NonCopyable.hpp b/include/util/NonCopyable.hpp
index 99804d2..22fdaf9 100755
--- a/include/util/NonCopyable.hpp
+++ b/include/util/NonCopyable.hpp
@@ -1,12 +1,12 @@
#ifndef __NONCOPYABLE_H
#define __NONCOPYABLE_H
-#include "Exportable.hpp"
+#include "UtilExportable.hpp"
namespace __dont_touch
{
-class DLL_VISIBLE noncopyable
+class UTIL_DLL_VISIBLE noncopyable
{
protected:
noncopyable( ) { }
diff --git a/include/util/ScopedPtr.hpp b/include/util/ScopedPtr.hpp
index 991409d..5fdd1f2 100755
--- a/include/util/ScopedPtr.hpp
+++ b/include/util/ScopedPtr.hpp
@@ -2,9 +2,10 @@
#define __SCOPEDPTR_H
#include "NonCopyable.hpp"
+#include "UtilExportable.hpp"
template< typename T >
-class DLL_VISIBLE scopedPtr : private noncopyable
+class UTIL_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 f291435..80ab5e8 100755
--- a/include/util/Singleton.hpp
+++ b/include/util/Singleton.hpp
@@ -3,7 +3,7 @@
#include "ScopedPtr.hpp"
#include "NonCopyable.hpp"
-#include "Exportable.hpp"
+#include "UtilExportable.hpp"
#include "Noreturn.hpp"
#include <cstdlib>
@@ -13,20 +13,11 @@
friend class Singleton< T >; \
friend class scopedPtr< T >;
-#define DEFINE_SINGLETON( T )
-
-#if 0
-#define DECLARE_SINGLETON( T ) \
-
-#define DEFINE_SINGLETON( T ) \
- DLL_EXTERN template class DLL_VISIBLE Singleton< T >;
-#endif
-
template< class T >
class Singleton : private noncopyable
{
public:
- DLL_VISIBLE static T& instance( )
+ UTIL_DLL_VISIBLE static T& instance( )
{
if( destroyed ) {
onDeadReference( );
diff --git a/include/util/UtilExportable.hpp b/include/util/UtilExportable.hpp
new file mode 100755
index 0000000..f9598f1
--- /dev/null
+++ b/include/util/UtilExportable.hpp
@@ -0,0 +1,26 @@
+#ifndef __UTIL_EXPORTABLE_H
+#define __UTIL_EXPORTABLE_H
+
+#ifndef _WIN32
+
+#define UTIL_DLL_VISIBLE
+
+#else
+
+#ifdef SHARED
+
+#ifdef BUILDING_UTIL
+#define UTIL_DLL_VISIBLE __declspec(dllexport)
+#else
+#define UTIL_DLL_VISIBLE __declspec(dllimport)
+#endif
+
+#else
+
+#define UTIL_DLL_VISIBLE
+
+#endif
+
+#endif
+
+#endif