Skip to content

Commit

Permalink
bpo-45847: Port _uuid to PY_STDLIB_MOD (GH-29741)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiran committed Nov 24, 2021
1 parent d5cd2ef commit 8af6481
Show file tree
Hide file tree
Showing 6 changed files with 391 additions and 74 deletions.
2 changes: 2 additions & 0 deletions Modules/Setup.stdlib.in
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@
# needs -lcrypt
@MODULE__HASHLIB_TRUE@_hashlib _hashopenssl.c

# Linux: -luuid, BSD/AIX: libc's uuid_create()
@MODULE__UUID_TRUE@_uuid _uuidmodule.c

############################################################################
# macOS specific modules
Expand Down
10 changes: 6 additions & 4 deletions Modules/_uuidmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
#define PY_SSIZE_T_CLEAN

#include "Python.h"
#ifdef HAVE_UUID_UUID_H
#include <uuid/uuid.h>
#elif defined(HAVE_UUID_H)
#include <uuid.h>
#if defined(HAVE_UUID_H)
// AIX, FreeBSD, libuuid with pkgconf
#include <uuid.h>
#elif defined(HAVE_UUID_UUID_H)
// libuuid without pkgconf
#include <uuid/uuid.h>
#endif

#ifdef MS_WINDOWS
Expand Down
Loading

0 comments on commit 8af6481

Please sign in to comment.