From: Bruno Haible Date: Fri, 7 Aug 2020 19:21:56 +0000 (+0200) Subject: Update after gnulib changed. X-Git-Tag: v0.22~331 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b8f214c7c9dee73d1053fe47894fb5a044f356ee;p=thirdparty%2Fgettext.git Update after gnulib changed. * gettext-runtime/intl/verify.h: Update from gnulib. * gettext-runtime/intl/vasnprintf.c: Likewise. * gettext-runtime/libasprintf/vasnprintf.c: Likewise. --- diff --git a/gettext-runtime/intl/vasnprintf.c b/gettext-runtime/intl/vasnprintf.c index 0ef77893c..079d6f174 100644 --- a/gettext-runtime/intl/vasnprintf.c +++ b/gettext-runtime/intl/vasnprintf.c @@ -633,7 +633,8 @@ divide (mpn_t a, mpn_t b, mpn_t *q) mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */ /* Determine s = GMP_LIMB_BITS - integer_length (msd). Code copied from gnulib's integer_length.c. */ -# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) \ + || (__clang_major__ >= 4) s = __builtin_clz (msd); # else # if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT diff --git a/gettext-runtime/intl/verify.h b/gettext-runtime/intl/verify.h index 11dc4bf7a..5efeed82d 100644 --- a/gettext-runtime/intl/verify.h +++ b/gettext-runtime/intl/verify.h @@ -233,6 +233,13 @@ template /* @assert.h omit start@ */ +#if defined __has_builtin +/* */ +# define _GL_HAS_BUILTIN_ASSUME __has_builtin (__builtin_assume) +#else +# define _GL_HAS_BUILTIN_ASSUME 0 +#endif + #if 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__)) # define _GL_HAS_BUILTIN_TRAP 1 #elif defined __has_builtin @@ -294,7 +301,9 @@ template diagnostics, performance can suffer if R uses hard-to-optimize features such as function calls not inlined by the compiler. */ -#if _GL_HAS_BUILTIN_UNREACHABLE +#if _GL_HAS_BUILTIN_ASSUME +# define assume(R) __builtin_assume (R) +#elif _GL_HAS_BUILTIN_UNREACHABLE # define assume(R) ((R) ? (void) 0 : __builtin_unreachable ()) #elif 1200 <= _MSC_VER # define assume(R) __assume (R) diff --git a/gettext-runtime/libasprintf/vasnprintf.c b/gettext-runtime/libasprintf/vasnprintf.c index 0ef77893c..079d6f174 100644 --- a/gettext-runtime/libasprintf/vasnprintf.c +++ b/gettext-runtime/libasprintf/vasnprintf.c @@ -633,7 +633,8 @@ divide (mpn_t a, mpn_t b, mpn_t *q) mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */ /* Determine s = GMP_LIMB_BITS - integer_length (msd). Code copied from gnulib's integer_length.c. */ -# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) \ + || (__clang_major__ >= 4) s = __builtin_clz (msd); # else # if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT