Skip to content

bpo-32493: [3.7] UUID module. Not only AIX, but FreeBSD has uid_create support #5089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from Jan 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UUID module fixes build for FreeBSD/OpenBSD
5 changes: 1 addition & 4 deletions Modules/_uuidmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -9562,8 +9562,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>
Expand Down
5 changes: 3 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
)
Expand Down
4 changes: 2 additions & 2 deletions pyconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@
/* Define to 1 if you have the <ieeefp.h> header file. */
#undef HAVE_IEEEFP_H

/* Define to 1 if you have the 'if_nameindex' function. */
/* Define to 1 if you have the `if_nameindex' function. */
#undef HAVE_IF_NAMEINDEX

/* Define if you have the 'inet_aton' function. */
Expand Down Expand Up @@ -1191,7 +1191,7 @@
/* 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. */
Expand Down