1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

fix for plugin mechanism on clang

This commit is contained in:
Steffen Vogel 2017-07-25 12:00:35 +02:00
parent 7b61a71b93
commit 4af0dd6584

View file

@ -35,6 +35,7 @@
#include "nodes/cbuilder.h"
/** @todo This is ugly as hell and broken on OS X / Clang anyway. */
#define REGISTER_PLUGIN(p) \
__attribute__((constructor(110))) static void UNIQUE(__ctor)() {\
if (plugins.state == STATE_DESTROYED) \
@ -42,7 +43,8 @@ __attribute__((constructor(110))) static void UNIQUE(__ctor)() {\
list_push(&plugins, p); \
} \
__attribute__((destructor(110))) static void UNIQUE(__dtor)() { \
list_remove(&plugins, p); \
if (plugins.state != STATE_DESTROYED) \
list_remove(&plugins, p); \
}
extern struct list plugins;