summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--gmp-impl.h9
-rw-r--r--printf/doprnt.c7
-rw-r--r--printf/repl-vsnprintf.c7
-rw-r--r--scanf/doscan.c7
-rw-r--r--tests/misc/t-printf.c7
-rw-r--r--tests/misc/t-scanf.c7
7 files changed, 27 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 6975ef085..8d8bf8523 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -33,6 +33,13 @@
* rand/randsd.c: Likewise.
* rand/randsdui.c: Likewise.
+ * gmp-impl.h: Include stdint.h even if we have inttypes.h.
+ * printf/doprnt.c: Likewise.
+ * printf/repl-vsnprintf.c: Likewise.
+ * scanf/doscan.c: Likewise.
+ * tests/misc/t-printf.c: Likewise.
+ * tests/misc/t-scanf.c: Likewise.
+
2021-06-03 Niels Möller <nisse@lysator.liu.se>
* mpn/generic/div_qr_1n_pi1.c (mpn_div_qr_1n_pi1): Micro-optimize
diff --git a/gmp-impl.h b/gmp-impl.h
index ab12bc1ca..66ffbd6cb 100644
--- a/gmp-impl.h
+++ b/gmp-impl.h
@@ -154,10 +154,11 @@ see https://www.gnu.org/licenses/. */
#if HAVE_INTTYPES_H /* for uint_least32_t */
# include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-# include <stdint.h>
-# endif
+#endif
+/* On some platforms inttypes.h exists but is incomplete
+ and we still need stdint.h. */
+#if HAVE_STDINT_H
+# include <stdint.h>
#endif
#ifdef __cplusplus
diff --git a/printf/doprnt.c b/printf/doprnt.c
index fa3f3029f..3b8661393 100644
--- a/printf/doprnt.c
+++ b/printf/doprnt.c
@@ -45,10 +45,9 @@ see https://www.gnu.org/licenses/. */
#if HAVE_INTTYPES_H
# include <inttypes.h> /* for intmax_t */
-#else
-# if HAVE_STDINT_H
-# include <stdint.h>
-# endif
+#endif
+#if HAVE_STDINT_H
+# include <stdint.h>
#endif
#if HAVE_LANGINFO_H
diff --git a/printf/repl-vsnprintf.c b/printf/repl-vsnprintf.c
index d22867122..81b404d12 100644
--- a/printf/repl-vsnprintf.c
+++ b/printf/repl-vsnprintf.c
@@ -50,10 +50,9 @@ see https://www.gnu.org/licenses/. */
#if HAVE_INTTYPES_H
# include <inttypes.h> /* for intmax_t */
-#else
-# if HAVE_STDINT_H
-# include <stdint.h>
-# endif
+#endif
+#if HAVE_STDINT_H
+# include <stdint.h>
#endif
#if HAVE_SYS_TYPES_H
diff --git a/scanf/doscan.c b/scanf/doscan.c
index eecd31b7f..35273a3ca 100644
--- a/scanf/doscan.c
+++ b/scanf/doscan.c
@@ -53,10 +53,9 @@ see https://www.gnu.org/licenses/. */
#if HAVE_INTTYPES_H
# include <inttypes.h> /* for intmax_t */
-#else
-# if HAVE_STDINT_H
-# include <stdint.h>
-# endif
+#endif
+#if HAVE_STDINT_H
+# include <stdint.h>
#endif
#if HAVE_SYS_TYPES_H
diff --git a/tests/misc/t-printf.c b/tests/misc/t-printf.c
index b0f6a30e6..ef104bad1 100644
--- a/tests/misc/t-printf.c
+++ b/tests/misc/t-printf.c
@@ -41,10 +41,9 @@ the GNU MP Library test suite. If not, see https://www.gnu.org/licenses/. */
#if HAVE_INTTYPES_H
# include <inttypes.h> /* for intmax_t */
-#else
-# if HAVE_STDINT_H
-# include <stdint.h>
-# endif
+#endif
+#if HAVE_STDINT_H
+# include <stdint.h>
#endif
#if HAVE_UNISTD_H
diff --git a/tests/misc/t-scanf.c b/tests/misc/t-scanf.c
index fdae5de1e..8b82f1e1d 100644
--- a/tests/misc/t-scanf.c
+++ b/tests/misc/t-scanf.c
@@ -39,10 +39,9 @@ the GNU MP Library test suite. If not, see https://www.gnu.org/licenses/. */
#if HAVE_INTTYPES_H
# include <inttypes.h> /* for intmax_t */
-#else
-# if HAVE_STDINT_H
-# include <stdint.h>
-# endif
+#endif
+#if HAVE_STDINT_H
+# include <stdint.h>
#endif
#if HAVE_UNISTD_H