From: Bruno Haible Date: Sun, 16 Dec 2018 09:46:13 +0000 (+0100) Subject: obstack, libc-config: Support HP-UX cc in C99 mode. X-Git-Tag: v1.0~5227 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=509a02974a0b22a8c2a05a8dcd4ac7d2e6d9152a;p=gnulib.git obstack, libc-config: Support HP-UX cc in C99 mode. * lib/obstack.h (__FLEXIBLE_ARRAY_MEMBER): Treat HP-UX cc as a pre-C99 compiler, even when in C99 mode. * lib/cdefs.h (__flexarr): Likewise. * lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Update comment. --- diff --git a/ChangeLog b/ChangeLog index 8c757c70fc..3ab3138f51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2018-12-16 Bruno Haible + + obstack, libc-config: Support HP-UX cc in C99 mode. + * lib/obstack.h (__FLEXIBLE_ARRAY_MEMBER): Treat HP-UX cc as a pre-C99 + compiler, even when in C99 mode. + * lib/cdefs.h (__flexarr): Likewise. + * lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Update comment. + 2018-12-16 Bruno Haible localename: Fix test failure on OpenBSD >= 6.2. diff --git a/lib/cdefs.h b/lib/cdefs.h index 98cf74995a..26e2f3fe98 100644 --- a/lib/cdefs.h +++ b/lib/cdefs.h @@ -139,7 +139,7 @@ Headers that should use flexible arrays only if they're "real" (e.g. only if they won't affect sizeof()) should test #if __glibc_c99_flexarr_available. */ -#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc # define __flexarr [] # define __glibc_c99_flexarr_available 1 #elif __GNUC_PREREQ (2,97) diff --git a/lib/gettext.h b/lib/gettext.h index 27c754c681..d5d56ec8f3 100644 --- a/lib/gettext.h +++ b/lib/gettext.h @@ -185,7 +185,7 @@ npgettext_aux (const char *domain, #include #if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \ - /* || __STDC_VERSION__ == 199901L + /* || (__STDC_VERSION__ == 199901L && !defined __HP_cc) || (__STDC_VERSION__ >= 201112L && !defined __STDC_NO_VLA__) */ ) # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1 #else diff --git a/lib/obstack.h b/lib/obstack.h index ed95ccea5a..4a89331321 100644 --- a/lib/obstack.h +++ b/lib/obstack.h @@ -111,7 +111,7 @@ #include /* For size_t and ptrdiff_t. */ #include /* For __GNU_LIBRARY__, and memcpy. */ -#if __STDC_VERSION__ < 199901L +#if __STDC_VERSION__ < 199901L || defined __HP_cc # define __FLEXIBLE_ARRAY_MEMBER 1 #else # define __FLEXIBLE_ARRAY_MEMBER