diff --git a/include/villas/plugin.h b/include/villas/plugin.h index ac2b6b962..d5494ccfb 100644 --- a/include/villas/plugin.h +++ b/include/villas/plugin.h @@ -28,28 +28,6 @@ #include #include -/** (De-)Register a plugin by adding it to the global plugin list. - * - * We make use of GCC's / Clang's constructor/destructor function - * attributes to let the following code be executed by the loader. - * This works only when we compile libvillas as a shared library! - * - * The __attribute__((constructor)) / __attribute__((destructor)) - * is currently only supported by GCC and Clang - * - * See: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes - */ -#define REGISTER_PLUGIN(p) \ -__attribute__((constructor(110))) static void UNIQUE(__ctor)() {\ - if (plugins.state == STATE_DESTROYED) \ - vlist_init(&plugins); \ - vlist_push(&plugins, p); \ -} \ -__attribute__((destructor(110))) static void UNIQUE(__dtor)() { \ - if (plugins.state != STATE_DESTROYED) \ - vlist_remove_all(&plugins, p); \ -} - extern struct vlist plugins; enum plugin_type { diff --git a/lib/formats/villas_binary.cpp b/lib/formats/villas_binary.cpp index 82d9e6481..aff22241a 100644 --- a/lib/formats/villas_binary.cpp +++ b/lib/formats/villas_binary.cpp @@ -132,7 +132,7 @@ __attribute__((constructor(110))) static void UNIQUE(__ctor)() { p1.format.size = 0; p1.format.flags = IO_HAS_BINARY_PAYLOAD | SAMPLE_HAS_TS_ORIGIN | SAMPLE_HAS_SEQUENCE | SAMPLE_HAS_DATA; - + vlist_push(&plugins, &p1); } @@ -164,5 +164,3 @@ __attribute__((destructor(110))) static void UNIQUE(__dtor)() { if (plugins.state != STATE_DESTROYED) vlist_remove_all(&plugins, &p2); } -REGISTER_PLUGIN(&p1); -REGISTER_PLUGIN(&p2);