diff options
author | randomdan <randomdan@localhost> | 2013-03-15 00:38:56 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2013-03-15 00:38:56 +0000 |
commit | 8b08b0d813f1fe49cb16e50d6be6d596dc148457 (patch) | |
tree | 109877c556072da1898dac964ddd25f7dc8739b6 | |
parent | Plugable CGI request routers (diff) | |
download | project2-8b08b0d813f1fe49cb16e50d6be6d596dc148457.tar.bz2 project2-8b08b0d813f1fe49cb16e50d6be6d596dc148457.tar.xz project2-8b08b0d813f1fe49cb16e50d6be6d596dc148457.zip |
Move component loader constructor/destructors into their own unique machine generated namespace out of the way
-rw-r--r-- | project2/common/scriptLoader.h | 6 |
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) \ |