diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-08-06 15:24:47 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-08-06 15:25:30 -0700 |
commit | 33b293b41b2cc64aa085bad9051507922434ceda (patch) | |
tree | 298002879802151ae9c9dd7dc82674185b591354 /lib | |
parent | 6cb6215cbe65a183e16adf9122280f8a0155ae10 (diff) | |
download | emacs-33b293b41b2cc64aa085bad9051507922434ceda.tar.gz |
Update from Gnulib
This incorporates:
2020-08-06 libgmp: add <gmp/gmp.h> support
2020-08-06 Consider that clang defines __OPTIMIZE__ like GCC does
2020-08-06 Use __builtin_expect with clang everywhere
2020-08-05 Use __builtin_clz{,l,ll} with clang, also on Windows
2020-08-05 Use __builtin_ctz{,l,ll} and __builtin_ffs{,l,ll} with clang
2020-07-31 _GL_CMP: Improve documentation
2020-07-30 alloca, largefile: sync with Autoconf master
* lib/c++defs.h, lib/cdefs.h, lib/count-leading-zeros.h:
* lib/count-trailing-zeros.h, m4/alloca.m4, m4/gnulib-common.m4:
* m4/largefile.m4, m4/libgmp.m4:
Copy from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/c++defs.h | 4 | ||||
-rw-r--r-- | lib/cdefs.h | 2 | ||||
-rw-r--r-- | lib/count-leading-zeros.h | 3 | ||||
-rw-r--r-- | lib/count-trailing-zeros.h | 3 | ||||
-rw-r--r-- | lib/gnulib.mk.in | 13 |
5 files changed, 17 insertions, 8 deletions
diff --git a/lib/c++defs.h b/lib/c++defs.h index 3e6aaabc9ce..182c2b3a88d 100644 --- a/lib/c++defs.h +++ b/lib/c++defs.h @@ -268,7 +268,7 @@ _GL_CXXALIASWARN_2 (func, namespace) /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, we enable the warning only when not optimizing. */ -# if !__OPTIMIZE__ +# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) # define _GL_CXXALIASWARN_2(func,namespace) \ _GL_WARN_ON_USE (func, \ "The symbol ::" #func " refers to the system function. " \ @@ -296,7 +296,7 @@ _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, we enable the warning only when not optimizing. */ -# if !__OPTIMIZE__ +# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ "The symbol ::" #func " refers to the system function. " \ diff --git a/lib/cdefs.h b/lib/cdefs.h index d8e4a000333..f6c447ad377 100644 --- a/lib/cdefs.h +++ b/lib/cdefs.h @@ -401,7 +401,7 @@ # endif #endif -#if __GNUC__ >= 3 +#if (__GNUC__ >= 3) || (__clang_major__ >= 4) # define __glibc_unlikely(cond) __builtin_expect ((cond), 0) # define __glibc_likely(cond) __builtin_expect ((cond), 1) #else diff --git a/lib/count-leading-zeros.h b/lib/count-leading-zeros.h index 7e88c8cb9d0..7cf605a5f64 100644 --- a/lib/count-leading-zeros.h +++ b/lib/count-leading-zeros.h @@ -38,7 +38,8 @@ extern "C" { expand to code that computes the number of leading zeros of the local variable 'x' of type TYPE (an unsigned integer type) and return it from the current function. */ -#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) \ + || (__clang_major__ >= 4) # define COUNT_LEADING_ZEROS(BUILTIN, MSC_BUILTIN, TYPE) \ return x ? BUILTIN (x) : CHAR_BIT * sizeof x; #elif _MSC_VER diff --git a/lib/count-trailing-zeros.h b/lib/count-trailing-zeros.h index 1eb5fb919f4..727b21dcc56 100644 --- a/lib/count-trailing-zeros.h +++ b/lib/count-trailing-zeros.h @@ -38,7 +38,8 @@ extern "C" { expand to code that computes the number of trailing zeros of the local variable 'x' of type TYPE (an unsigned integer type) and return it from the current function. */ -#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) \ + || (__clang_major__ >= 4) # define COUNT_TRAILING_ZEROS(BUILTIN, MSC_BUILTIN, TYPE) \ return x ? BUILTIN (x) : CHAR_BIT * sizeof x; #elif _MSC_VER diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index 4dc180d2e33..92d0621c61a 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -246,9 +246,10 @@ GL_GENERATE_ALLOCA_H = @GL_GENERATE_ALLOCA_H@ GL_GENERATE_BYTESWAP_H = @GL_GENERATE_BYTESWAP_H@ GL_GENERATE_ERRNO_H = @GL_GENERATE_ERRNO_H@ GL_GENERATE_EXECINFO_H = @GL_GENERATE_EXECINFO_H@ -GL_GENERATE_GMP_H = @GL_GENERATE_GMP_H@ +GL_GENERATE_GMP_GMP_H = @GL_GENERATE_GMP_GMP_H@ GL_GENERATE_IEEE754_H = @GL_GENERATE_IEEE754_H@ GL_GENERATE_LIMITS_H = @GL_GENERATE_LIMITS_H@ +GL_GENERATE_MINI_GMP_H = @GL_GENERATE_MINI_GMP_H@ GL_GENERATE_STDALIGN_H = @GL_GENERATE_STDALIGN_H@ GL_GENERATE_STDDEF_H = @GL_GENERATE_STDDEF_H@ GL_GENERATE_STDINT_H = @GL_GENERATE_STDINT_H@ @@ -1085,7 +1086,6 @@ gamedir = @gamedir@ gamegroup = @gamegroup@ gameuser = @gameuser@ gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7 = @gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7@ -gl_GNULIB_ENABLED_2049e887c7e5308faad27b3f894bb8c9 = @gl_GNULIB_ENABLED_2049e887c7e5308faad27b3f894bb8c9@ gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b = @gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b@ gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31 = @gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31@ gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c = @gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c@ @@ -2021,15 +2021,22 @@ ifeq (,$(OMIT_GNULIB_MODULE_libgmp)) BUILT_SOURCES += $(GMP_H) +ifneq (,$(GL_GENERATE_MINI_GMP_H)) # Build gmp.h as a wrapper for mini-gmp.h when using mini-gmp. -ifneq (,$(GL_GENERATE_GMP_H)) gmp.h: $(top_builddir)/config.status echo '#include "mini-gmp.h"' >$@-t mv $@-t $@ else +ifneq (,$(GL_GENERATE_GMP_GMP_H)) +# Build gmp.h as a wrapper for gmp/gmp.h. +gmp.h: $(top_builddir)/config.status + echo '#include <gmp/gmp.h>' >$@-t + mv $@-t $@ +else gmp.h: $(top_builddir)/config.status rm -f $@ endif +endif MOSTLYCLEANFILES += gmp.h gmp.h-t EXTRA_DIST += mini-gmp-gnulib.c mini-gmp.c mini-gmp.h |