summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2013-03-15 00:38:56 +0000
committerrandomdan <randomdan@localhost>2013-03-15 00:38:56 +0000
commita44308c6ca2546b7e25479c0fe181ccdfb860029 (patch)
tree109877c556072da1898dac964ddd25f7dc8739b6
parentPlugable CGI request routers (diff)
downloadproject2-a44308c6ca2546b7e25479c0fe181ccdfb860029.tar.bz2
project2-a44308c6ca2546b7e25479c0fe181ccdfb860029.tar.xz
project2-a44308c6ca2546b7e25479c0fe181ccdfb860029.zip
Move component loader constructor/destructors into their own unique machine generated namespace out of the way
-rw-r--r--project2/common/scriptLoader.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/project2/common/scriptLoader.h b/project2/common/scriptLoader.h
index feb958b..2582a52 100644
--- a/project2/common/scriptLoader.h
+++ b/project2/common/scriptLoader.h
@@ -101,11 +101,15 @@ class LoaderBase {
const Glib::ustring ns;
};
+#define TOKENPASTE(x, y) x ## y
+#define TOKENPASTE2(x, y) TOKENPASTE(x, y)
#define DECLARE_CUSTOM_COMPONENT_LOADER(N, I, T, B) \
+namespace TOKENPASTE2(I, __LINE__) { \
static void init_loader_##I() __attribute__ ((constructor(201))); \
static void init_loader_##I() { LoaderBase::newLoader<B>(N, new T()); } \
static void kill_loader_##I() __attribute__ ((destructor(201))); \
- static void kill_loader_##I() { LoaderBase::removeLoader<B>(N); }
+ static void kill_loader_##I() { LoaderBase::removeLoader<B>(N); } \
+}
#define DECLARE_CUSTOM_LOADER(N, T) \
DECLARE_CUSTOM_COMPONENT_LOADER(N, T, T, ElementLoader)
#define DECLARE_COMPONENT_LOADER(N, T, B) \