From: Bruno Haible Date: Sat, 27 Jan 2018 13:09:55 +0000 (+0100) Subject: xgettext: Support '_' in number tokens in C++. X-Git-Tag: v0.20~423 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbdc20dd3aadbe4cd1e28052a0bb3e1a86c526c6;p=thirdparty%2Fgettext.git xgettext: Support '_' in number tokens in C++. * gettext-tools/src/x-c.c (phase5_get): Recognize '_' in C++. * NEWS: Update. --- diff --git a/NEWS b/NEWS index 57933c35d..d5c09799f 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ - C, C++: xgettext now supports 'p'/'P' exponent markers in number tokens, as specified in C99 and C++17. + - C++: + xgettext now supports underscores in number tokens. - C++: xgettext now supports single-quotes in number tokens, as specified in C++14. diff --git a/gettext-tools/src/x-c.c b/gettext-tools/src/x-c.c index 3dd25499a..e2d4e5448 100644 --- a/gettext-tools/src/x-c.c +++ b/gettext-tools/src/x-c.c @@ -1438,6 +1438,17 @@ phase5_get (token_ty *tp) case '.': continue; + case '_': + if (cxx_extensions) + /* In C++, an underscore can be part of a preprocessing number + token. */ + continue; + else + { + phase4_ungetc (c); + break; + } + case '\'': if (cxx_extensions) {