[PATCH 1/2] tools/gmp: declare standard headers relied upon by gmp-impl.h
Vladimir Savelev
anykey196 at gmail.com
Fri Oct 2 00:15:23 PDT 2026
gmp-impl.h guards its <stdint.h> include with HAVE_STDINT_H, but that
macro is not declared in acinclude.m4, so autoheader does not emit a
template for it and it stays undefined in config.h. Since gmp-impl.h
also uses intptr_t (guarded by HAVE_INTPTR_T, which *is* detected),
builds fail with "unknown type name 'intptr_t'".
The same applies to inttypes.h, unistd.h and sys/types.h, which
configure.ac relies on the autoconf default tests for.
Declare them with AH_TEMPLATE so autoheader emits the templates.
This patch was prepared with the assistance of AI tools.
Signed-off-by: Vladimir Savelev <anykey196 at gmail.com>
---
...cinclude-m4-declare-standard-headers.patch | 30 +++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 tools/gmp/patches/003-acinclude-m4-declare-standard-headers.patch
diff --git a/tools/gmp/patches/003-acinclude-m4-declare-standard-headers.patch b/tools/gmp/patches/003-acinclude-m4-declare-standard-headers.patch
new file mode 100644
index 000000000..09006cf70
--- /dev/null
+++ b/tools/gmp/patches/003-acinclude-m4-declare-standard-headers.patch
@@ -0,0 +1,30 @@
+Declare the standard headers relied upon by gmp-impl.h in acinclude.m4
+
+gmp-impl.h guards its <stdint.h> include with HAVE_STDINT_H, but that
+macro is not declared in acinclude.m4, so autoheader does not emit a
+template for it and it stays undefined in config.h. Since gmp-impl.h
+also uses intptr_t (guarded by HAVE_INTPTR_T, which *is* detected),
+builds fail with "unknown type name 'intptr_t'".
+
+The same applies to inttypes.h, unistd.h and sys/types.h, which
+configure.ac relies on the autoconf default tests for.
+
+Declare them with AH_TEMPLATE so autoheader emits the templates.
+
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -1,5 +1,14 @@
+ dnl GMP specific autoconf macros
+
++dnl gmp-impl.h guards the standard header includes with these macros, and
++dnl relies on the autoconf default tests to detect them. Declare them here
++dnl so that autoheader emits the templates for config.h.in; otherwise they
++dnl end up undefined in config.h.
++AH_TEMPLATE([HAVE_STDINT_H], [Define to 1 if you have the <stdint.h> header file.])
++AH_TEMPLATE([HAVE_INTTYPES_H], [Define to 1 if you have the <inttypes.h> header file.])
++AH_TEMPLATE([HAVE_UNISTD_H], [Define to 1 if you have the <unistd.h> header file.])
++AH_TEMPLATE([HAVE_SYS_TYPES_H], [Define to 1 if you have the <sys/types.h> header file.])
++
+
+ dnl Copyright 2000-2006, 2009, 2011, 2013-2018 Free Software Foundation, Inc.
+ dnl
More information about the openwrt-devel
mailing list