From d68b009cfec31ddef2bb4f4909f86746cbce42e3 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 19 May 2021 16:38:33 +1000 Subject: [PATCH] Remove priority from attribute constructor/destructor On some platforms, the __attribute__ constructor and destructor won't take priorities and the compilation failed. On such platform would be macOS. For this reason, the constructor/destructor in the libisc was reworked to not use priorities, but have a single constructor and destructor that calls the appropriate routines in correct order. This commit removes the extra priority because it's now not needed and it also breaks a compilation on macOS with GCC 10. --- lib/isc/include/isc/util.h | 8 ++++---- lib/isc/lib.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/isc/include/isc/util.h b/lib/isc/include/isc/util.h index 64c26587ac..f0f7f85fa4 100644 --- a/lib/isc/include/isc/util.h +++ b/lib/isc/include/isc/util.h @@ -49,11 +49,11 @@ #endif /* __GNUC__ */ #if HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR && HAVE_FUNC_ATTRIBUTE_DESTRUCTOR -#define ISC_CONSTRUCTOR(priority) __attribute__((constructor(priority))) -#define ISC_DESTRUCTOR(priority) __attribute__((destructor(priority))) +#define ISC_CONSTRUCTOR __attribute__((constructor)) +#define ISC_DESTRUCTOR __attribute__((destructor)) #elif WIN32 -#define ISC_CONSTRUCTOR(priority) -#define ISC_DESTRUCTOR(priority) +#define ISC_CONSTRUCTOR +#define ISC_DESTRUCTOR #endif /*% diff --git a/lib/isc/lib.c b/lib/isc/lib.c index 31724218ff..2d6950ad63 100644 --- a/lib/isc/lib.c +++ b/lib/isc/lib.c @@ -36,9 +36,9 @@ isc_lib_register(void) { } void -isc__initialize(void) ISC_CONSTRUCTOR(101); +isc__initialize(void) ISC_CONSTRUCTOR; void -isc__shutdown(void) ISC_DESTRUCTOR(101); +isc__shutdown(void) ISC_DESTRUCTOR; void isc__initialize(void) {