Avoid compilation errors with some C++ compilers.
authorBruno Haible <bruno@clisp.org>
Wed, 25 Oct 2006 16:14:34 +0000 (16:14 +0000)
committerBruno Haible <bruno@clisp.org>
Wed, 25 Oct 2006 16:14:34 +0000 (16:14 +0000)
ChangeLog
lib/gettext.h

index 58f53df650f68e4b4053259386d85b28dc100026..b3cc38c9bf49fa0a41f47dab84d9c64e95c5b5d7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-10-25  Bruno Haible  <bruno@clisp.org>
+
+       * lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Define to
+       false for PGI C++ and Sun C++ compilers.
+       Reported by Nelson H. F. Beebe <beebe@math.utah.edu>.
+
 2006-10-24  Bruno Haible  <bruno@clisp.org>
 
        * lib/striconv.c (mem_cd_iconv, str_cd_iconv): Treat all non-GNU
index 70e2c1c267a33ff2354308619b0e51fea0a34086..6e4d5ead8b5dbb8bf53ac5f655f9a251118742a7 100644 (file)
@@ -163,8 +163,12 @@ npgettext_aux (const char *domain,
 
 #include <string.h>
 
+/* GCC supports variable-size arrays in C and C++ mode.
+   ISO C++ supports variable-size arrays, but some older PGI and Sun compilers
+   don't.  */
 #define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
-  (__GNUC__ >= 3 || defined __cplusplus)
+  (__GNUC__ >= 3 \
+   || (defined __cplusplus && !(defined __PGI || defined __SUNPRO_CC)))
 
 #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
 #include <stdlib.h>