]> Savannah Git Hosting - gnulib.git/commitdiff
unitypes: Fix trouble caused by installed older versions of unitypes.h.
authorBruno Haible <bruno@clisp.org>
Sun, 20 Jun 2021 01:14:22 +0000 (03:14 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 20 Jun 2021 01:14:22 +0000 (03:14 +0200)
* modules/unitypes (configure.ac): Define _UC_RESTRICT through config.h.

ChangeLog
modules/unitypes

index acfdca21a1033fab283e248843baeee2b702d711..a43fcf60c8d6ce723bf795db3ac1b0a003b7d0f4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2021-06-19  Bruno Haible  <bruno@clisp.org>
+
+       unitypes: Fix trouble caused by installed older versions of unitypes.h.
+       * modules/unitypes (configure.ac): Define _UC_RESTRICT through config.h.
+
 2021-06-19  Bruno Haible  <bruno@clisp.org>
 
        sigsegv, sigsegv-tests: Assign my contributions to the FSF.
index 8d3ccf0c195f918b9f5db0d1192dd7b3e9e756bc..46ed80d8c83cfae0d099e0380b96cacd0df31117 100644 (file)
@@ -11,6 +11,22 @@ stdint
 configure.ac:
 gl_LIBUNISTRING_LIBHEADER([0.9.11], [unitypes.h])
 
+AH_VERBATIM([unitypes_restrict], [
+/* This definition is a duplicate of the one in unitypes.h.
+   It is here so that we can cope with an older version of unitypes.h
+   that does not contain this definition and that is pre-installed among
+   the public header files.  */
+# if defined __restrict \
+     || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
+     || __clang_major__ >= 3
+#  define _UC_RESTRICT __restrict
+# elif 199901L <= __STDC_VERSION__ || defined restrict
+#  define _UC_RESTRICT restrict
+# else
+#  define _UC_RESTRICT
+# endif
+])
+
 Makefile.am:
 BUILT_SOURCES += $(LIBUNISTRING_UNITYPES_H)