From: Paul Eggert Date: Thu, 12 Jul 2012 04:16:27 +0000 (-0700) Subject: gettext: do not assume '#define ... defined ...' behavior X-Git-Tag: v0.1~545 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=beee741c19d9287cbabe78a06c458a1d74cffa5d;p=gnulib.git gettext: 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 . --- diff --git a/ChangeLog b/ChangeLog index b27ef8db0..7dacfb7e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-07-11 Paul Eggert + + gettext: 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-07-10 Paul Eggert getloadavg: clean out old Emacs and Autoconf cruft diff --git a/lib/gettext.h b/lib/gettext.h index 1c5cab9e3..c63d9072a 100644 --- a/lib/gettext.h +++ b/lib/gettext.h @@ -183,9 +183,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