]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] bpo-11102: Make configure enable major(), makedev(), and minor() on HP-UX...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 28 Dec 2023 11:12:16 +0000 (12:12 +0100)
committerGitHub <noreply@github.com>
Thu, 28 Dec 2023 11:12:16 +0000 (11:12 +0000)
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>
Misc/NEWS.d/next/Build/2020-05-01-23-44-31.bpo-11102.Fw9zeS.rst [new file with mode: 0644]
Modules/posixmodule.c
configure
configure.ac

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 (file)
index 0000000..6477538
--- /dev/null
@@ -0,0 +1,2 @@
+The :func:`os.major`, :func:`os.makedev`, and :func:`os.minor` functions are
+now available on HP-UX v3.
index 0ac5a8d371419f4d6e4d6368823949cb6cc6e8e0..3468ab4632d811c6cdfe9613dab1edf5b95e0696 100644 (file)
@@ -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 */
index 89cb0af392e556a890b19d01edc91c1326782465..02cb431639503ebfc356771d8547d52e27357059 100755 (executable)
--- 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>
index 4ae70a10ef8141fd4546561fbc320e83e48b21cf..49475ad3e998b6d14307adb11221c15d04675492 100644 (file)
@@ -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>