diff options
-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) \ |