]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-32493: Not only AIX, but FreeBSD has uuid_create support (#5089)
authorDavid Carlier <dcarlier@afilias.info>
Tue, 9 Jan 2018 19:38:07 +0000 (19:38 +0000)
committerAntoine Pitrou <pitrou@free.fr>
Tue, 9 Jan 2018 19:38:07 +0000 (20:38 +0100)
Allow building the _uuid extension module on FreeBSD and OpenBSD.

Misc/NEWS.d/next/Library/2018-01-08-15-53-37.bpo-32493.vTXxGN.rst [new file with mode: 0644]
Modules/_uuidmodule.c
configure
configure.ac
pyconfig.h.in

diff --git a/Misc/NEWS.d/next/Library/2018-01-08-15-53-37.bpo-32493.vTXxGN.rst b/Misc/NEWS.d/next/Library/2018-01-08-15-53-37.bpo-32493.vTXxGN.rst
new file mode 100644 (file)
index 0000000..82d33aa
--- /dev/null
@@ -0,0 +1 @@
+UUID module fixes build for FreeBSD/OpenBSD
index 1b37511c2286785c3205b02c5b8cae1cdcf6b376..16aa09b04ff2090453df0b13ceab3c7c4666b7ce 100644 (file)
@@ -19,10 +19,7 @@ py_uuid_generate_time_safe(void)
     res = uuid_generate_time_safe(uuid);
     return Py_BuildValue("y#i", (const char *) uuid, sizeof(uuid), res);
 #elif HAVE_UUID_CREATE
-/*
- * AIX support for uuid - RFC4122
- */
-    unsigned32 status;
+    uint32_t status;
     uuid_create(&uuid, &status);
     return Py_BuildValue("y#i", (const char *) &uuid, sizeof(uuid), (int) status);
 #else
index afffc19075133bba6f1608eeba8cb0f2ad8936cc..9286443124a0017a951de4082b529a6dcb5510b1 100755 (executable)
--- a/configure
+++ b/configure
@@ -9560,8 +9560,9 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 # AIX provides support for RFC4122 (uuid) in libc.a starting with AIX 6.1 (anno 2007)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RFC4122 - uuid support on AIX" >&5
-$as_echo_n "checking for RFC4122 - uuid support on AIX... " >&6; }
+# FreeBSD and OpenBSD provides support as well
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_create" >&5
+$as_echo_n "checking for uuid_create... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <uuid.h>
index 0a48e41d5c3b3a519ee17dbcece857e09d18ed5b..1894e21f30446dece7f5582ab5ee6b5960439079 100644 (file)
@@ -2696,13 +2696,14 @@ void *x = uuid_generate_time_safe
 )
 
 # AIX provides support for RFC4122 (uuid) in libc.a starting with AIX 6.1 (anno 2007)
-AC_MSG_CHECKING(for RFC4122 - uuid support on AIX)
+# FreeBSD and OpenBSD provides support as well
+AC_MSG_CHECKING(for uuid_create)
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <uuid.h>]], [[
 #ifndef uuid_create
 void *x = uuid_create
 #endif
 ]])],
-  [AC_DEFINE(HAVE_UUID_CREATE, 1, Define if uuid_create() exists. AIX support for uuid:RFC4122)
+  [AC_DEFINE(HAVE_UUID_CREATE, 1, Define if uuid_create() exists.)
    AC_MSG_RESULT(yes)],
   [AC_MSG_RESULT(no)]
 )
index 7d366562b0c3ba5c8a3c2cac458e5a5d21e7c46f..ff1083ae0b000438ce0a2587e9a8a3c24fa2bcf5 100644 (file)
 /* Define to 1 if you have the <utime.h> header file. */
 #undef HAVE_UTIME_H
 
-/* Define if uuid_create() exists. AIX support for uuid:RFC4122 */
+/* Define if uuid_create() exists. */
 #undef HAVE_UUID_CREATE
 
 /* Define if uuid_generate_time_safe() exists. */