summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2023-12-28 10:47:44 (GMT)
committerGitHub <noreply@github.com>2023-12-28 10:47:44 (GMT)
commitf108468970bf4e70910862476900f924fb701399 (patch)
tree9fef4c48842c8df326240a17400635e9a15d1f59
parentf1676867b52f8b6c7f70bf32e2a53f7edd6700a7 (diff)
downloadcpython-f108468970bf4e70910862476900f924fb701399.zip
cpython-f108468970bf4e70910862476900f924fb701399.tar.gz
cpython-f108468970bf4e70910862476900f924fb701399.tar.bz2
bpo-11102: Make configure enable major(), makedev(), and minor() on HP-UX (GH-19856)
Always include <sys/types.h> before <sys/sysmacros.h>. 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 c635fd4..f4a1853 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -236,15 +236,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 6d65d3a..3322b7a6 100755
--- a/configure
+++ b/configure
@@ -21805,6 +21805,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 bfdabc4..13a6d74 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5102,6 +5102,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>