Skip to content

Commit 8af6481

Browse files
authored
bpo-45847: Port _uuid to PY_STDLIB_MOD (GH-29741)
1 parent d5cd2ef commit 8af6481

File tree

6 files changed

+391
-74
lines changed

6 files changed

+391
-74
lines changed

Modules/Setup.stdlib.in

+2
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@
136136
# needs -lcrypt
137137
@MODULE__HASHLIB_TRUE@_hashlib _hashopenssl.c
138138

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

140142
############################################################################
141143
# macOS specific modules

Modules/_uuidmodule.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
#define PY_SSIZE_T_CLEAN
77

88
#include "Python.h"
9-
#ifdef HAVE_UUID_UUID_H
10-
#include <uuid/uuid.h>
11-
#elif defined(HAVE_UUID_H)
12-
#include <uuid.h>
9+
#if defined(HAVE_UUID_H)
10+
// AIX, FreeBSD, libuuid with pkgconf
11+
#include <uuid.h>
12+
#elif defined(HAVE_UUID_UUID_H)
13+
// libuuid without pkgconf
14+
#include <uuid/uuid.h>
1315
#endif
1416

1517
#ifdef MS_WINDOWS

0 commit comments

Comments
 (0)