bpo-32399: Starting with AIX6.1 there is support in libc.a for uuid (RFC4122) (#4974)
Starting with AIX6.1 there is support in libc.a for uuid (RFC4122) This patch provides the changes needed for this integration with the OS. On AIX the base function is uuid_create() rather than uuid_generate_time() The AIX uuid_t typedef is more aligned to the UUID field based definition while the Linux typedef that is more aligned with UUID bytes (or perhaps UUID bytes_le) definitions.
This commit is contained in:
parent
0c36bed1c4
commit
0d3ccb4395
|
@ -0,0 +1 @@
|
||||||
|
Add AIX uuid library support for RFC4122 using uuid_create() in libc.a
|
|
@ -1,22 +1,33 @@
|
||||||
#define PY_SSIZE_T_CLEAN
|
#define PY_SSIZE_T_CLEAN
|
||||||
|
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
|
#ifdef HAVE_UUID_UUID_H
|
||||||
#include <uuid/uuid.h>
|
#include <uuid/uuid.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_UUID_H
|
||||||
|
#include <uuid.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
py_uuid_generate_time_safe(void)
|
py_uuid_generate_time_safe(void)
|
||||||
{
|
{
|
||||||
|
uuid_t uuid;
|
||||||
#ifdef HAVE_UUID_GENERATE_TIME_SAFE
|
#ifdef HAVE_UUID_GENERATE_TIME_SAFE
|
||||||
uuid_t out;
|
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
res = uuid_generate_time_safe(out);
|
res = uuid_generate_time_safe(uuid);
|
||||||
return Py_BuildValue("y#i", (const char *) out, sizeof(out), res);
|
return Py_BuildValue("y#i", (const char *) uuid, sizeof(uuid), res);
|
||||||
|
#elif HAVE_UUID_CREATE
|
||||||
|
/*
|
||||||
|
* AIX support for uuid - RFC4122
|
||||||
|
*/
|
||||||
|
unsigned32 status;
|
||||||
|
uuid_create(&uuid, &status);
|
||||||
|
return Py_BuildValue("y#i", (const char *) &uuid, sizeof(uuid), (int) status);
|
||||||
#else
|
#else
|
||||||
uuid_t out;
|
uuid_generate_time(uuid);
|
||||||
uuid_generate_time(out);
|
return Py_BuildValue("y#O", (const char *) uuid, sizeof(uuid), Py_None);
|
||||||
return Py_BuildValue("y#O", (const char *) out, sizeof(out), Py_None);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9516,6 +9516,21 @@ _ACEOF
|
||||||
fi
|
fi
|
||||||
# Dynamic linking for HP-UX
|
# Dynamic linking for HP-UX
|
||||||
|
|
||||||
|
# checks for uuid.h location
|
||||||
|
for ac_header in uuid/uuid.h uuid.h
|
||||||
|
do :
|
||||||
|
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
||||||
|
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
|
||||||
|
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_time_safe" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_time_safe" >&5
|
||||||
$as_echo_n "checking for uuid_generate_time_safe... " >&6; }
|
$as_echo_n "checking for uuid_generate_time_safe... " >&6; }
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
@ -9546,6 +9561,37 @@ $as_echo "no" >&6; }
|
||||||
fi
|
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)
|
||||||
|
{ $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; }
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
#include <uuid.h>
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
#ifndef uuid_create
|
||||||
|
void *x = uuid_create
|
||||||
|
#endif
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_compile "$LINENO"; then :
|
||||||
|
|
||||||
|
$as_echo "#define HAVE_UUID_CREATE 1" >>confdefs.h
|
||||||
|
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||||
|
$as_echo "yes" >&6; }
|
||||||
|
else
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||||
|
$as_echo "no" >&6; }
|
||||||
|
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
|
||||||
# 'Real Time' functions on Solaris
|
# 'Real Time' functions on Solaris
|
||||||
# posix4 on Solaris 2.6
|
# posix4 on Solaris 2.6
|
||||||
# pthread (first!) on Linux
|
# pthread (first!) on Linux
|
||||||
|
|
15
configure.ac
15
configure.ac
|
@ -2681,6 +2681,9 @@ AC_CHECK_LIB(sendfile, sendfile)
|
||||||
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
|
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
|
||||||
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
|
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
|
||||||
|
|
||||||
|
# checks for uuid.h location
|
||||||
|
AC_CHECK_HEADERS([uuid/uuid.h uuid.h])
|
||||||
|
|
||||||
AC_MSG_CHECKING(for uuid_generate_time_safe)
|
AC_MSG_CHECKING(for uuid_generate_time_safe)
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <uuid/uuid.h>]], [[
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <uuid/uuid.h>]], [[
|
||||||
#ifndef uuid_generate_time_safe
|
#ifndef uuid_generate_time_safe
|
||||||
|
@ -2692,6 +2695,18 @@ void *x = uuid_generate_time_safe
|
||||||
[AC_MSG_RESULT(no)]
|
[AC_MSG_RESULT(no)]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# 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)
|
||||||
|
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_MSG_RESULT(yes)],
|
||||||
|
[AC_MSG_RESULT(no)]
|
||||||
|
)
|
||||||
|
|
||||||
# 'Real Time' functions on Solaris
|
# 'Real Time' functions on Solaris
|
||||||
# posix4 on Solaris 2.6
|
# posix4 on Solaris 2.6
|
||||||
# pthread (first!) on Linux
|
# pthread (first!) on Linux
|
||||||
|
|
|
@ -1191,9 +1191,18 @@
|
||||||
/* 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 */
|
||||||
|
#undef HAVE_UUID_CREATE
|
||||||
|
|
||||||
/* Define if uuid_generate_time_safe() exists. */
|
/* Define if uuid_generate_time_safe() exists. */
|
||||||
#undef HAVE_UUID_GENERATE_TIME_SAFE
|
#undef HAVE_UUID_GENERATE_TIME_SAFE
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <uuid.h> header file. */
|
||||||
|
#undef HAVE_UUID_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <uuid/uuid.h> header file. */
|
||||||
|
#undef HAVE_UUID_UUID_H
|
||||||
|
|
||||||
/* Define to 1 if you have the `wait3' function. */
|
/* Define to 1 if you have the `wait3' function. */
|
||||||
#undef HAVE_WAIT3
|
#undef HAVE_WAIT3
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue