From 34abd68afd21ed0a91033624de782893ea102562 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 25 Oct 2006 16:14:34 +0000 Subject: [PATCH] Avoid compilation errors with some C++ compilers. --- ChangeLog | 6 ++++++ lib/gettext.h | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 58f53df65..b3cc38c9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-10-25 Bruno Haible + + * lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Define to + false for PGI C++ and Sun C++ compilers. + Reported by Nelson H. F. Beebe . + 2006-10-24 Bruno Haible * lib/striconv.c (mem_cd_iconv, str_cd_iconv): Treat all non-GNU diff --git a/lib/gettext.h b/lib/gettext.h index 70e2c1c26..6e4d5ead8 100644 --- a/lib/gettext.h +++ b/lib/gettext.h @@ -163,8 +163,12 @@ npgettext_aux (const char *domain, #include +/* 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 -- 2.11.0