summaryrefslogtreecommitdiff
path: root/libadhocutil/plugins.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-09-14 20:21:32 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-09-14 20:21:32 +0100
commit4e7d73fa948532e3fabe06ffdcf73b60ec078df5 (patch)
tree9066f98f4316c96cf05d3892c5d2bc2711d4cef7 /libadhocutil/plugins.h
parentFix typeid use in PluginOf (diff)
downloadlibadhocutil-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.h3
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__); \