From f108468970bf4e70910862476900f924fb701399 Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Thu, 28 Dec 2023 02:47:44 -0800 Subject: [PATCH] bpo-11102: Make configure enable major(), makedev(), and minor() on HP-UX (GH-19856) Always include before . Co-authored-by: Serhiy Storchaka --- .../next/Build/2020-05-01-23-44-31.bpo-11102.Fw9zeS.rst | 2 ++ Modules/posixmodule.c | 9 +++++---- configure | 1 + configure.ac | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2020-05-01-23-44-31.bpo-11102.Fw9zeS.rst 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 00000000000..6477538edf5 --- /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 c635fd4d993..f4a18536e8f 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -236,15 +236,16 @@ corresponding Unix manual entries for more information on calls."); # include #endif +#ifdef HAVE_SYS_TYPES_H +/* Should be included before on HP-UX v3 */ +# include +#endif /* HAVE_SYS_TYPES_H */ + #ifdef HAVE_SYS_SYSMACROS_H /* GNU C Library: major(), minor(), makedev() */ # include #endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif /* HAVE_SYS_TYPES_H */ - #ifdef HAVE_SYS_STAT_H # include #endif /* HAVE_SYS_STAT_H */ diff --git a/configure b/configure index 6d65d3abc18..3322b7a682d 100755 --- a/configure +++ b/configure @@ -21805,6 +21805,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #if defined(MAJOR_IN_MKDEV) #include #elif defined(MAJOR_IN_SYSMACROS) +#include #include #else #include diff --git a/configure.ac b/configure.ac index bfdabc4474e..13a6d746763 100644 --- a/configure.ac +++ b/configure.ac @@ -5102,6 +5102,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #if defined(MAJOR_IN_MKDEV) #include #elif defined(MAJOR_IN_SYSMACROS) +#include #include #else #include