From: Ondřej Surý Date: Tue, 21 Aug 2018 13:33:08 +0000 (+0200) Subject: Assume PTHREAD_ONCE_INIT is not broken (remove support for ancient Solaris) X-Git-Tag: v9.13.3~30^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52e1c451565c3334fdfe34162fd5da61c85addce;p=thirdparty%2Fbind9.git Assume PTHREAD_ONCE_INIT is not broken (remove support for ancient Solaris) --- diff --git a/configure b/configure index 9c500585cc5..6d3b3c2ce5a 100755 --- a/configure +++ b/configure @@ -719,7 +719,6 @@ ISC_PLATFORM_HAVEXADD ISC_PLATFORM_HAVESTDATOMIC ISC_PLATFORM_HAVEIFNAMETOINDEX ISC_PLATFORM_HAVESTRINGSH -ISC_PLATFORM_BRACEPTHREADONCEINIT IRS_PLATFORM_USEDECLSPEC ISC_PLATFORM_USEDECLSPEC ISC_PLATFORM_HAVESTATNSEC @@ -18396,40 +18395,6 @@ IRS_PLATFORM_USEDECLSPEC="#undef IRS_PLATFORM_USEDECLSPEC" # XXXDCL print messages to indicate some compensation is being done? # -ISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT" - -case "$host" in - *-solaris2.[89]) - hack_shutup_pthreadonceinit=yes - ;; - *-solaris2.1[0-9]) - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - #include -int -main () -{ - static pthread_once_t once_test = { PTHREAD_ONCE_INIT }; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - hack_shutup_pthreadonceinit=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ;; -esac - -case "$hack_shutup_pthreadonceinit" in - yes) - # - # Shut up PTHREAD_ONCE_INIT unbraced initializer warnings. - # - ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1" - ;; -esac - for ac_header in strings.h do : ac_fn_c_check_header_mongrel "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default" diff --git a/configure.in b/configure.in index 7b58c42558d..be9a178edc1 100644 --- a/configure.in +++ b/configure.in @@ -2206,26 +2206,6 @@ IRS_PLATFORM_USEDECLSPEC="#undef IRS_PLATFORM_USEDECLSPEC" # Random remaining OS-specific issues involving compiler warnings. # XXXDCL print messages to indicate some compensation is being done? # -AC_SUBST(ISC_PLATFORM_BRACEPTHREADONCEINIT) -ISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT" - -case "$host" in - [*-solaris2.[89]]) - hack_shutup_pthreadonceinit=yes - ;; - *-solaris2.1[[0-9]]) - AC_TRY_COMPILE([ #include ], [ static pthread_once_t once_test = { PTHREAD_ONCE_INIT }; ], [hack_shutup_pthreadonceinit=yes], ) - ;; -esac - -case "$hack_shutup_pthreadonceinit" in - yes) - # - # Shut up PTHREAD_ONCE_INIT unbraced initializer warnings. - # - ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1" - ;; -esac AC_CHECK_HEADERS(strings.h, ISC_PLATFORM_HAVESTRINGSH="#define ISC_PLATFORM_HAVESTRINGSH 1" diff --git a/lib/isc/include/isc/platform.h.in b/lib/isc/include/isc/platform.h.in index d2bcdd8aa10..a2d3a37a03a 100644 --- a/lib/isc/include/isc/platform.h.in +++ b/lib/isc/include/isc/platform.h.in @@ -134,12 +134,6 @@ */ @ISC_PLATFORM_HAVELONGLONG@ -/* - * Define if PTHREAD_ONCE_INIT should be surrounded by braces to - * prevent compiler warnings (such as with gcc on Solaris 2.8). - */ -@ISC_PLATFORM_BRACEPTHREADONCEINIT@ - /* * Used to control how extern data is linked; needed for Win32 platforms. */ diff --git a/lib/isc/pthreads/include/isc/once.h b/lib/isc/pthreads/include/isc/once.h index a0e955939c5..71cd16b82fd 100644 --- a/lib/isc/pthreads/include/isc/once.h +++ b/lib/isc/pthreads/include/isc/once.h @@ -22,17 +22,7 @@ typedef pthread_once_t isc_once_t; -#ifdef ISC_PLATFORM_BRACEPTHREADONCEINIT -/*! - * This accomodates systems that define PTHRAD_ONCE_INIT improperly. - */ -#define ISC_ONCE_INIT { PTHREAD_ONCE_INIT } -#else -/*! - * This is the usual case. - */ #define ISC_ONCE_INIT PTHREAD_ONCE_INIT -#endif /* XXX We could do fancier error handling... */