mirror of https://github.com/python/cpython
bpo-32493: Not only AIX, but FreeBSD has uuid_create support (#5089)
Allow building the _uuid extension module on FreeBSD and OpenBSD.
This commit is contained in:
parent
2ab3a8fd26
commit
b4ebaa7099
|
@ -0,0 +1 @@
|
||||||
|
UUID module fixes build for FreeBSD/OpenBSD
|
|
@ -19,10 +19,7 @@ py_uuid_generate_time_safe(void)
|
||||||
res = uuid_generate_time_safe(uuid);
|
res = uuid_generate_time_safe(uuid);
|
||||||
return Py_BuildValue("y#i", (const char *) uuid, sizeof(uuid), res);
|
return Py_BuildValue("y#i", (const char *) uuid, sizeof(uuid), res);
|
||||||
#elif HAVE_UUID_CREATE
|
#elif HAVE_UUID_CREATE
|
||||||
/*
|
uint32_t status;
|
||||||
* AIX support for uuid - RFC4122
|
|
||||||
*/
|
|
||||||
unsigned32 status;
|
|
||||||
uuid_create(&uuid, &status);
|
uuid_create(&uuid, &status);
|
||||||
return Py_BuildValue("y#i", (const char *) &uuid, sizeof(uuid), (int) status);
|
return Py_BuildValue("y#i", (const char *) &uuid, sizeof(uuid), (int) status);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -9560,8 +9560,9 @@ fi
|
||||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
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)
|
# 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
|
# FreeBSD and OpenBSD provides support as well
|
||||||
$as_echo_n "checking for RFC4122 - uuid support on AIX... " >&6; }
|
{ $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
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
/* end confdefs.h. */
|
/* end confdefs.h. */
|
||||||
#include <uuid.h>
|
#include <uuid.h>
|
||||||
|
|
|
@ -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)
|
# 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>]], [[
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <uuid.h>]], [[
|
||||||
#ifndef uuid_create
|
#ifndef uuid_create
|
||||||
void *x = uuid_create
|
void *x = uuid_create
|
||||||
#endif
|
#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(yes)],
|
||||||
[AC_MSG_RESULT(no)]
|
[AC_MSG_RESULT(no)]
|
||||||
)
|
)
|
||||||
|
|
|
@ -1191,7 +1191,7 @@
|
||||||
/* Define to 1 if you have the <utime.h> header file. */
|
/* Define to 1 if you have the <utime.h> header file. */
|
||||||
#undef HAVE_UTIME_H
|
#undef HAVE_UTIME_H
|
||||||
|
|
||||||
/* Define if uuid_create() exists. AIX support for uuid:RFC4122 */
|
/* Define if uuid_create() exists. */
|
||||||
#undef HAVE_UUID_CREATE
|
#undef HAVE_UUID_CREATE
|
||||||
|
|
||||||
/* Define if uuid_generate_time_safe() exists. */
|
/* Define if uuid_generate_time_safe() exists. */
|
||||||
|
|
Loading…
Reference in New Issue