From: Junio C Hamano Date: Fri, 6 Mar 2015 23:02:24 +0000 (-0800) Subject: Merge branch 'ye/http-accept-language' X-Git-Tag: v2.4.0-rc0~62 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/74c91d1f7a1e7848a3614c1c5031755bfa5e80e1 Merge branch 'ye/http-accept-language' Compilation fix for a recent topic in 'master'. * ye/http-accept-language: gettext.c: move get_preferred_languages() from http.c --- 74c91d1f7a1e7848a3614c1c5031755bfa5e80e1 diff --cc gettext.h index dc1722dd4b,e539482ae7..33696a40b8 --- a/gettext.h +++ b/gettext.h @@@ -63,30 -63,8 +63,32 @@@ const char *Q_(const char *msgid, cons } /* Mark msgid for translation but do not translate it. */ +#if !USE_PARENS_AROUND_GETTEXT_N #define N_(msgid) msgid +#else +/* + * Strictly speaking, this will lead to invalid C when + * used this way: + * static const char s[] = N_("FOO"); + * which will expand to + * static const char s[] = ("FOO"); + * and in valid C, the initializer on the right hand side must + * be without the parentheses. But many compilers do accept it + * as a language extension and it will allow us to catch mistakes + * like: + * static const char *msgs[] = { + * N_("one") + * N_("two"), + * N_("three"), + * NULL + * }; + * (notice the missing comma on one of the lines) by forcing + * a compilation error, because parenthesised ("one") ("two") + * will not get silently turned into ("onetwo"). + */ +#define N_(msgid) (msgid) +#endif + const char *get_preferred_languages(void); + #endif