]> Savannah Git Hosting - gnulib.git/commitdiff
obstack, libc-config: Support HP-UX cc in C99 mode.
authorBruno Haible <bruno@clisp.org>
Sun, 16 Dec 2018 09:46:13 +0000 (10:46 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 16 Dec 2018 09:46:13 +0000 (10:46 +0100)
* 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.

ChangeLog
lib/cdefs.h
lib/gettext.h
lib/obstack.h

index 8c757c70fc13feb9f5c75bea0789ba5160f2c5af..3ab3138f510ec801b97d5b841615b0af9e4c0ef5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2018-12-16  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        localename: Fix test failure on OpenBSD >= 6.2.
index 98cf74995a547cd8c34900e7f1a0a2681b58a6c0..26e2f3fe98324969d78d996638d0d36190d0ca56 100644 (file)
    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)
index 27c754c68116f3cb8b6d18886ba826be6fe668b6..d5d56ec8f337f0e146d09519f554f0bc5df91a1a 100644 (file)
@@ -185,7 +185,7 @@ npgettext_aux (const char *domain,
 #include <string.h>
 
 #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
index ed95ccea5aa963bf527bab046c411fbb26596660..4a89331321a7a702ee43a54c369c5de510554cb8 100644 (file)
 #include <stddef.h>             /* For size_t and ptrdiff_t.  */
 #include <string.h>             /* 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