From: Petr Mensik Date: Fri, 26 Mar 2021 10:01:59 +0000 (+0100) Subject: Do not require config.h to use isc/util.h X-Git-Tag: v9.17.12~23^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=81eb3396bfe6125fe2d6cfb1f7b26508db368af8;p=thirdparty%2Fbind9.git Do not require config.h to use isc/util.h 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. --- diff --git a/lib/isc/include/isc/util.h b/lib/isc/include/isc/util.h index 2d990150347..64c26587acf 100644 --- a/lib/isc/include/isc/util.h +++ b/lib/isc/include/isc/util.h @@ -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 /*% diff --git a/lib/isc/lib.c b/lib/isc/lib.c index b1afa2b3554..31724218ff9 100644 --- a/lib/isc/lib.c +++ b/lib/isc/lib.c @@ -17,10 +17,15 @@ #include #include +#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 ***/