summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2016-12-10 11:26:23 +0100
committerBruno Haible <bruno@clisp.org>2016-12-10 11:26:23 +0100
commit37a4dfd41674500647a0376d252ab8e8a5bfd118 (patch)
tree25a187c378f93b7687108710c07f23ab71f682de
parent873aa4f61ca1cb0d331a547d138b57ded067a44c (diff)
downloadlibunistring-37a4dfd41674500647a0376d252ab8e8a5bfd118.tar.gz
Make the generated <unistring/stdint.h> work for GCC >= 4.5 when GCC is not the system's default compiler.
-rw-r--r--ChangeLog9
-rw-r--r--lib/Makefile.am5
2 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1f605e3..6f93463 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-12-10 Bruno Haible <bruno@clisp.org>
+
+ Make the generated <unistring/stdint.h> work for GCC >= 4.5
+ when GCC is not the system's default compiler.
+ * lib/Makefile.am (unistring/stdint.h): When the compiler is
+ GCC >= 4.5, include its <stdint.h> file.
+ Reported by Marcin Cieślak and analyzed by Krzysztof Malinowski
+ at <https://savannah.gnu.org/bugs/?45783>.
+
2016-12-02 Daiki Ueno <ueno@gnu.org>
* version.sh: Bump version number and date.
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 265ff46..1e13235 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -91,6 +91,7 @@ EXTRA_DIST += stdbool.mini.h
# Produce an unistring/stdint.h that is not compiler dependent.
# Glibc >= 2 has <stdint.h>.
+# GCC >= 4.5 provides <stdint.h>, see https://gcc.gnu.org/gcc-4.5/changes.html.
# On most other platforms that have it, it is buggy in one way or the other.
unistring/stdint.h : $(STDINT_H) stdint.mini.h
@MKDIR_P@ unistring
@@ -103,7 +104,7 @@ unistring/stdint.h : $(STDINT_H) stdint.mini.h
if test -f /usr/include/stdint.h; then \
HAVE_STDINT_H='1'; \
else \
- HAVE_STDINT_H='defined __MINGW32__ || defined __HAIKU__'; \
+ HAVE_STDINT_H='defined __MINGW32__ || defined __HAIKU__ || ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) && !defined __NetBSD__)'; \
fi; \
if test -f /usr/include/inttypes.h; then \
HAVE_INTTYPES_H='1'; \
@@ -115,6 +116,8 @@ unistring/stdint.h : $(STDINT_H) stdint.mini.h
else \
HAVE_SYS_INTTYPES_H='0'; \
fi; \
+ sed_escape_ampersands='s/&/\\&/g'; \
+ HAVE_STDINT_H=`echo "$$HAVE_STDINT_H" | sed -e "$$sed_escape_ampersands"`; \
sed -e 's/@''HAVE_STDINT_H''@/'"$$HAVE_STDINT_H"'/g' \
-e 's|@''INCLUDE_NEXT''@|include|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@||g' \