]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove priority from attribute constructor/destructor
authorMark Andrews <marka@isc.org>
Wed, 19 May 2021 06:38:33 +0000 (16:38 +1000)
committerOndřej Surý <ondrej@sury.org>
Thu, 27 May 2021 06:02:21 +0000 (08:02 +0200)
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
lib/isc/lib.c

index 64c26587acf349b6699a136e8d3d5de3009cf435..f0f7f85fa4610a12e6cfbad17855a0520894b4f2 100644 (file)
 #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
 
 /*%
index 31724218ff920da1a34497a9560e49e728a4ebc8..2d6950ad6383f5c4ae2d247d13acb20d3a24c876 100644 (file)
@@ -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) {