diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-09-14 20:21:32 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-09-14 20:21:32 +0100 |
commit | 4e7d73fa948532e3fabe06ffdcf73b60ec078df5 (patch) | |
tree | 9066f98f4316c96cf05d3892c5d2bc2711d4cef7 /libadhocutil/plugins.h | |
parent | Fix typeid use in PluginOf (diff) | |
download | libadhocutil-4e7d73fa948532e3fabe06ffdcf73b60ec078df5.tar.bz2 libadhocutil-4e7d73fa948532e3fabe06ffdcf73b60ec078df5.tar.xz libadhocutil-4e7d73fa948532e3fabe06ffdcf73b60ec078df5.zip |
Create a unique namespace for plugin registry functions
Diffstat (limited to 'libadhocutil/plugins.h')
-rw-r--r-- | libadhocutil/plugins.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libadhocutil/plugins.h b/libadhocutil/plugins.h index 69dd05c..5efd5b5 100644 --- a/libadhocutil/plugins.h +++ b/libadhocutil/plugins.h @@ -11,6 +11,7 @@ #include <set> #include <algorithm> #include "visibility.h" +#include "unique.h" namespace std { DLL_PUBLIC @@ -146,7 +147,7 @@ namespace AdHoc { } #define NAMEDPLUGIN(Name, Implementation, Base) \ - namespace { \ + namespace MAKE_UNIQUE(__plugin__) { \ static void InstallPlugin() __attribute__((constructor(102))); \ void InstallPlugin() { \ ::AdHoc::PluginManager::getDefault()->add<Base>(new Implementation(), Name, __FILE__, __LINE__); \ |