]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Do not require config.h to use isc/util.h
authorPetr Mensik <pemensik@redhat.com>
Fri, 26 Mar 2021 10:01:59 +0000 (11:01 +0100)
committerPetr Menšík <pemensik@redhat.com>
Fri, 26 Mar 2021 10:41:22 +0000 (11:41 +0100)
util.h requires ISC_CONSTRUCTOR definition, which depends on config.h
inclusion. It does not include it from isc/util.h (or any other header).
Using isc/util.h fails hard when isc/util.h is used without including
bind's config.h.

Move the check to c file, where ISC_CONSTRUCTOR is used. Ensure config.h
is included there.

lib/isc/include/isc/util.h
lib/isc/lib.c

index 2d99015034709659e5075f9c23a2a916412145dd..64c26587acf349b6699a136e8d3d5de3009cf435 100644 (file)
@@ -54,8 +54,6 @@
 #elif WIN32
 #define ISC_CONSTRUCTOR(priority)
 #define ISC_DESTRUCTOR(priority)
-#else
-#error Either __attribute__((constructor|destructor))__ or DllMain support needed to compile BIND 9.
 #endif
 
 /*%
index b1afa2b35542a663d27ffbdd5a6651a084718f76..31724218ff920da1a34497a9560e49e728a4ebc8 100644 (file)
 #include <isc/tls.h>
 #include <isc/util.h>
 
+#include "config.h"
 #include "mem_p.h"
 #include "tls_p.h"
 #include "trampoline_p.h"
 
+#ifndef ISC_CONSTRUCTOR
+#error Either __attribute__((constructor|destructor))__ or DllMain support needed to compile BIND 9.
+#endif
+
 /***
  *** Functions
  ***/