From d23f1ee2f96e00c108a63c9849aabc1608b81e8a Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 5 May 2021 14:59:56 +0100 Subject: [Rework] Use C++ version of the lua threads pool --- config.h.in | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'config.h.in') diff --git a/config.h.in b/config.h.in index 85a1fe829..c52506f8e 100644 --- a/config.h.in +++ b/config.h.in @@ -419,6 +419,12 @@ extern uint64_t ottery_rand_uint64(void); #endif #endif +#ifdef __cplusplus + #define RSPAMD_CONSTRUCTOR(f) \ + static void f(void); \ + struct f##_t_ { f##_t_(void) { f(); } }; static f##_t_ f##_; \ + static void f(void) +#else #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) #define RSPAMD_CONSTRUCTOR(f) \ static void f(void) __attribute__((constructor)); \ @@ -430,6 +436,7 @@ extern uint64_t ottery_rand_uint64(void); /* In fact, everything else is not supported ¯\_(ツ)_/¯ */ #error incompatible compiler found, need gcc > 2.7 or clang #endif +#endif /* __cplusplus */ #ifdef __GNUC__ #define RSPAMD_CONST_FUNCTION __attribute__ ((const)) -- cgit v1.2.3