summaryrefslogtreecommitdiff
path: root/tests/modules
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2012-08-21 09:39:49 +0200
committerAndreas Baumann <abaumann@yahoo.com>2012-08-21 09:39:49 +0200
commitcf1f5367d2a87cb0585009f343eeb3350efbb076 (patch)
treee97befc8c3a54a9f6d89457797537672b837706a /tests/modules
parente9dde47720316d5450c434121989c4b524fe79a6 (diff)
downloadcrawler-cf1f5367d2a87cb0585009f343eeb3350efbb076.tar.gz
crawler-cf1f5367d2a87cb0585009f343eeb3350efbb076.tar.bz2
fixed singleton double-instance problem on Windows, not a really nice solution
Diffstat (limited to 'tests/modules')
-rwxr-xr-xtests/modules/Common.hpp10
-rwxr-xr-xtests/modules/Makefile.W322
-rwxr-xr-xtests/modules/testmod2/Makefile.W323
3 files changed, 13 insertions, 2 deletions
diff --git a/tests/modules/Common.hpp b/tests/modules/Common.hpp
index dc1f22a..4be89bb 100755
--- a/tests/modules/Common.hpp
+++ b/tests/modules/Common.hpp
@@ -20,4 +20,14 @@ class Common : public Singleton< Common >
void print( string s ) { cout << m_name << ": " << s << endl; }
};
+#ifndef SHARED
+#define SINGLETON_EXPORT __declspec(dllexport)
+#define SINGLETON_EXTERN
+#else
+#define SINGLETON_EXPORT __declspec(dllimport)
+#define SINGLETON_EXTERN extern
+#endif
+
+SINGLETON_EXTERN template class SINGLETON_EXPORT Singleton< Common >;
+
#endif
diff --git a/tests/modules/Makefile.W32 b/tests/modules/Makefile.W32
index 8a745a0..6dfa78b 100755
--- a/tests/modules/Makefile.W32
+++ b/tests/modules/Makefile.W32
@@ -27,7 +27,7 @@ OBJS =
test1.exe: test1.obj
test2.exe: test2.obj
-local_all:
+local_all: test2.exe
local_clean:
@-erase -f *.RES *.DIFF *.ERR 2>NUL
diff --git a/tests/modules/testmod2/Makefile.W32 b/tests/modules/testmod2/Makefile.W32
index 9640019..f1ae5e1 100755
--- a/tests/modules/testmod2/Makefile.W32
+++ b/tests/modules/testmod2/Makefile.W32
@@ -15,7 +15,8 @@ INCLUDE_DIRS = \
INCLUDE_LDFLAGS = \
INCLUDE_LIBS = \
- $(TOPDIR)\src\crawler.lib
+ $(TOPDIR)\src\crawler.lib \
+ ..\test2.lib
DYNAMIC_MODULE = \
mod_test2.dll