From: Joe Orton Date: Mon, 12 Dec 2005 10:10:33 +0000 (+0000) Subject: * include/ap_config.h: Define AP_HAVE_DESIGNATED_INITIALIZER for GCC X-Git-Tag: 2.3.0~2671 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2160d59157defbc2f11e158473b793c7bdeeccbc;p=thirdparty%2Fapache%2Fhttpd.git * include/ap_config.h: Define AP_HAVE_DESIGNATED_INITIALIZER for GCC (but not G++) or any compiler which claims C99 support. * configure.in: Don't define AP_HAVE_DESIGNATED_INITIALIZER here. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@356234 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/configure.in b/configure.in index 06436d47558..09ff3041a09 100644 --- a/configure.in +++ b/configure.in @@ -360,10 +360,6 @@ AC_HEADER_SYS_WAIT dnl ## Check for typedefs, structures, and compiler characteristics. AC_C_CONST -if test "x$GCC" = "xyes"; then - AC_DEFINE([AP_HAVE_DESIGNATED_INITIALIZER], 1, - [Define if the compiler supports designated initializers]) -fi dnl ## Check for library functions AC_SEARCH_LIBS(sqrt, m) diff --git a/include/ap_config.h b/include/ap_config.h index a580e67b499..8bd6e0de4fb 100644 --- a/include/ap_config.h +++ b/include/ap_config.h @@ -252,4 +252,12 @@ #define AP_HAVE_RELIABLE_PIPED_LOGS TRUE #endif +/* Presume that the compiler supports C99-style designated + * initializers if using GCC (but not G++), or for any other compiler + * which claims C99 support. */ +#if (defined(__GNUC__) && !defined(__cplusplus)) \ + || (defined(__STDC_VERSION) && __STDC_VERSION__ >= 199901L) +#define AP_HAVE_DESIGNATED_INITIALIZER +#endif + #endif /* AP_CONFIG_H */