]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-11102: Make configure enable major(), makedev(), and minor() on HP-UX (GH-19856)
authorZackery Spytz <zspytz@gmail.com>
Thu, 28 Dec 2023 10:47:44 +0000 (02:47 -0800)
committerGitHub <noreply@github.com>
Thu, 28 Dec 2023 10:47:44 +0000 (12:47 +0200)
Always include <sys/types.h> before <sys/sysmacros.h>.

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 c635fd4d993d57dd6837852677379d1ab30ece2b..f4a18536e8f1e11f9d3596f2482e7cc70a329e37 100644 (file)
@@ -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 */
index 6d65d3abc1811b1a2d9a122bbf8c6767903b1baf..3322b7a682dd250f255dc3be6464f187bb431105 100755 (executable)
--- 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>
index bfdabc4474e5eb97f45cf39db99ba119dea9302f..13a6d746763d62d3183666617e53129e5832b89f 100644 (file)
@@ -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>