From: Bruno Haible Date: Sun, 13 Oct 2019 18:25:46 +0000 (+0200) Subject: Update after gnulib changed. X-Git-Tag: v0.20.2~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3873cae5d8aa07a5c16f3f9325dfc7213b93d75d;p=thirdparty%2Fgettext.git Update after gnulib changed. * gettext-runtime/intl/localcharset.c: Update from gnulib. * gettext-runtime/intl/verify.h: Likewise. --- diff --git a/gettext-runtime/intl/localcharset.c b/gettext-runtime/intl/localcharset.c index af4254d46..1fa4a01f9 100644 --- a/gettext-runtime/intl/localcharset.c +++ b/gettext-runtime/intl/localcharset.c @@ -378,8 +378,6 @@ static const struct table_entry alias_table[] = by Alex Taylor: . See also "__convcp() of kLIBC": - , - or: . */ { "CP1004", "CP1252" }, /*{ "CP1041", "CP943" },*/ diff --git a/gettext-runtime/intl/verify.h b/gettext-runtime/intl/verify.h index f39a4dc2d..011641417 100644 --- a/gettext-runtime/intl/verify.h +++ b/gettext-runtime/intl/verify.h @@ -56,6 +56,16 @@ # undef _Static_assert #endif +/* If the compiler lacks __has_builtin, define it well enough for this + source file only. */ +#ifndef __has_builtin +# define __has_builtin(x) _GL_HAS_##x +# define _GL_HAS___builtin_unreachable (4 < __GNUC__ + (5 <= __GNUC_MINOR__)) +# define _GL_HAS___builtin_trap \ + (3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))) +# define _GL_TEMPDEF___has_builtin +#endif + /* Each of these macros verifies that its argument R is nonzero. To be portable, R should be an integer constant expression. Unlike assert (R), there is no run-time overhead. @@ -260,24 +270,17 @@ template # define verify(R) _GL_VERIFY (R, "verify (" #R ")", -) #endif -#ifndef __has_builtin -# define __has_builtin(x) 0 -#endif - /* Assume that R always holds. Behavior is undefined if R is false, fails to evaluate, or has side effects. Although assuming R can help a compiler generate better code or diagnostics, performance can suffer if R uses hard-to-optimize features such as function calls not inlined by the compiler. */ -#if (__has_builtin (__builtin_unreachable) \ - || 4 < __GNUC__ + (5 <= __GNUC_MINOR__)) +#if __has_builtin (__builtin_unreachable) # define assume(R) ((R) ? (void) 0 : __builtin_unreachable ()) #elif 1200 <= _MSC_VER # define assume(R) __assume (R) -#elif ((defined GCC_LINT || defined lint) \ - && (__has_builtin (__builtin_trap) \ - || 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__)))) +#elif (defined GCC_LINT || defined lint) && __has_builtin (__builtin_trap) /* Doing it this way helps various packages when configured with --enable-gcc-warnings, which compiles with -Dlint. It's nicer when 'assume' silences warnings even with older GCCs. */ @@ -287,6 +290,13 @@ template # define assume(R) ((R) ? (void) 0 : /*NOTREACHED*/ (void) 0) #endif +#ifdef _GL_TEMPDEF___has_builtin +# undef __has_builtin +# undef _GL_HAS___builtin_unreachable +# undef _GL_HAS___builtin_trap +# undef _GL_TEMPDEF___has_builtin +#endif + /* @assert.h omit end@ */ #endif