From 81eb3396bfe6125fe2d6cfb1f7b26508db368af8 Mon Sep 17 00:00:00 2001 From: Petr Mensik Date: Fri, 26 Mar 2021 11:01:59 +0100 Subject: [PATCH] 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. --- lib/isc/include/isc/util.h | 2 -- lib/isc/lib.c | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/isc/include/isc/util.h b/lib/isc/include/isc/util.h index 2d99015034..64c26587ac 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 b1afa2b355..31724218ff 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 ***/