mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-11063: Add a configure check for uuid_generate_time_safe (GH-4287)
This commit is contained in:
parent
bf9d317626
commit
9a10ff4deb
4 changed files with 48 additions and 9 deletions
|
@ -4,17 +4,10 @@
|
|||
#include <uuid/uuid.h>
|
||||
|
||||
|
||||
/* bpo-11063: libuuid on macOS doesn't provide uuid_generate_time_safe(),
|
||||
only uuid_generate_time(). */
|
||||
#ifndef __APPLE__
|
||||
# define HAVE_TIME_SAFE
|
||||
#endif
|
||||
|
||||
|
||||
static PyObject *
|
||||
py_uuid_generate_time_safe(void)
|
||||
{
|
||||
#ifdef HAVE_TIME_SAFE
|
||||
#ifdef HAVE_UUID_GENERATE_TIME_SAFE
|
||||
uuid_t out;
|
||||
int res;
|
||||
|
||||
|
@ -45,7 +38,7 @@ PyInit__uuid(void)
|
|||
{
|
||||
PyObject *mod;
|
||||
assert(sizeof(uuid_t) == 16);
|
||||
#ifdef HAVE_TIME_SAFE
|
||||
#ifdef HAVE_UUID_GENERATE_TIME_SAFE
|
||||
int has_uuid_generate_time_safe = 1;
|
||||
#else
|
||||
int has_uuid_generate_time_safe = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue