From: Bruno Haible Date: Sun, 15 Jul 2012 13:40:50 +0000 (+0200) Subject: Do not assume '#define ... defined ...' behavior. X-Git-Tag: v0.18.2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=937f4d948b716f80af2395b7ff98acb37acc0c4d;p=thirdparty%2Fgettext.git Do not assume '#define ... defined ...' behavior. --- diff --git a/gnulib-local/ChangeLog b/gnulib-local/ChangeLog index a0240555f..cb4c736c1 100644 --- a/gnulib-local/ChangeLog +++ b/gnulib-local/ChangeLog @@ -1,3 +1,12 @@ +2012-07-11 Paul Eggert + + Do not assume '#define ... defined ...' behavior. + * lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): + Do not use '#define FOO ... defined BAR ...', as the C standard says + it's not portable to expect that this works after macro expansion. + Problem reported for gzip by Steven M. Schweda in + . + 2012-06-03 Jim Meyering * lib/tparm.c: Spelling fixes. diff --git a/gnulib-local/lib/gettext.h b/gnulib-local/lib/gettext.h index fbbbce18b..9d4055d12 100644 --- a/gnulib-local/lib/gettext.h +++ b/gnulib-local/lib/gettext.h @@ -182,9 +182,12 @@ npgettext_aux (const char *domain, #include -#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ - (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \ - /* || __STDC_VERSION__ >= 199901L */ ) +#if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \ + /* || __STDC_VERSION__ >= 199901L */ ) +# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1 +#else +# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0 +#endif #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS #include