]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] 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:02:23 +0000 (12:02 +0100)
committerGitHub <noreply@github.com>
Thu, 28 Dec 2023 11:02:23 +0000 (11:02 +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 9ac021f6c5f8b0984e1220bedb65d956263746fc..e70fef5ebfe3aaaa90fca2f63d5a1874cff762e1 100644 (file)
@@ -220,15 +220,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 8d2f3f4cc0fa5f4717ca3a2cf66cd3f700124451..86228da3ebe22fa5dbfd47f8374141a1263d0a05 100755 (executable)
--- a/configure
+++ b/configure
@@ -18754,6 +18754,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 52d5c1f7dd3593f3f825fc82af841f76315745ca..4c0d00533606cab61f0df55399d5153a8e853fe2 100644 (file)
@@ -4995,6 +4995,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>