summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-12-28 11:12:16 (GMT)
committerGitHub <noreply@github.com>2023-12-28 11:12:16 (GMT)
commit0e3cf5bcaca7cc98fd77b43d74e51a47987f5089 (patch)
treeabaf373c39e3f269a3de7a6ca28f462b06a648de
parent72073ca5603bbd8d8a00b51fe508d3465f95f634 (diff)
downloadcpython-0e3cf5bcaca7cc98fd77b43d74e51a47987f5089.zip
cpython-0e3cf5bcaca7cc98fd77b43d74e51a47987f5089.tar.gz
cpython-0e3cf5bcaca7cc98fd77b43d74e51a47987f5089.tar.bz2
[3.12] bpo-11102: Make configure enable major(), makedev(), and minor() on HP-UX (GH-19856) (GH-113540)
Always include <sys/types.h> before <sys/sysmacros.h>. (cherry picked from commit f108468970bf4e70910862476900f924fb701399) Co-authored-by: Zackery Spytz <zspytz@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
-rw-r--r--Misc/NEWS.d/next/Build/2020-05-01-23-44-31.bpo-11102.Fw9zeS.rst2
-rw-r--r--Modules/posixmodule.c9
-rwxr-xr-xconfigure1
-rw-r--r--configure.ac1
4 files changed, 9 insertions, 4 deletions
diff --git a/Misc/NEWS.d/next/Build/2020-05-01-23-44-31.bpo-11102.Fw9zeS.rst b/Misc/NEWS.d/next/Build/2020-05-01-23-44-31.bpo-11102.Fw9zeS.rst
new file mode 100644
index 0000000..6477538
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2020-05-01-23-44-31.bpo-11102.Fw9zeS.rst
@@ -0,0 +1,2 @@
+The :func:`os.major`, :func:`os.makedev`, and :func:`os.minor` functions are
+now available on HP-UX v3.
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 0ac5a8d..3468ab4 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -226,15 +226,16 @@ corresponding Unix manual entries for more information on calls.");
# include <sys/uio.h>
#endif
+#ifdef HAVE_SYS_TYPES_H
+/* Should be included before <sys/sysmacros.h> on HP-UX v3 */
+# include <sys/types.h>
+#endif /* HAVE_SYS_TYPES_H */
+
#ifdef HAVE_SYS_SYSMACROS_H
/* GNU C Library: major(), minor(), makedev() */
# include <sys/sysmacros.h>
#endif
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif /* HAVE_SYS_TYPES_H */
-
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif /* HAVE_SYS_STAT_H */
diff --git a/configure b/configure
index 89cb0af..02cb431 100755
--- a/configure
+++ b/configure
@@ -22359,6 +22359,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#if defined(MAJOR_IN_MKDEV)
#include <sys/mkdev.h>
#elif defined(MAJOR_IN_SYSMACROS)
+#include <sys/types.h>
#include <sys/sysmacros.h>
#else
#include <sys/types.h>
diff --git a/configure.ac b/configure.ac
index 4ae70a1..49475ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5260,6 +5260,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#if defined(MAJOR_IN_MKDEV)
#include <sys/mkdev.h>
#elif defined(MAJOR_IN_SYSMACROS)
+#include <sys/types.h>
#include <sys/sysmacros.h>
#else
#include <sys/types.h>