[Python-checkins] bpo-32627: Fix compile error when conflicting `_uuid` headers included (GH-11751)

Miss Islington (bot) webhook-mailer at python.org
Mon Jun 24 14:28:04 EDT 2019


https://github.com/python/cpython/commit/76b72f6ea26de4280279a01863f30fccd2dde8f3
commit: 76b72f6ea26de4280279a01863f30fccd2dde8f3
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-06-24T11:27:57-07:00
summary:

bpo-32627: Fix compile error when conflicting `_uuid` headers included (GH-11751)

(cherry picked from commit 6ffd9b05dfade9e3a101fe039157856eb855f82e)

Co-authored-by: ziheng <zihenglv at gmail.com>

files:
A Misc/NEWS.d/next/Library/2019-02-03-19-13-08.bpo-32627.b68f64.rst
M Modules/_uuidmodule.c

diff --git a/Misc/NEWS.d/next/Library/2019-02-03-19-13-08.bpo-32627.b68f64.rst b/Misc/NEWS.d/next/Library/2019-02-03-19-13-08.bpo-32627.b68f64.rst
new file mode 100644
index 000000000000..16708aa5ee54
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-02-03-19-13-08.bpo-32627.b68f64.rst
@@ -0,0 +1 @@
+Fix compile error when ``_uuid`` headers conflicting included.
diff --git a/Modules/_uuidmodule.c b/Modules/_uuidmodule.c
index 0b7f2a2545d4..0b7aa72e91a1 100644
--- a/Modules/_uuidmodule.c
+++ b/Modules/_uuidmodule.c
@@ -1,14 +1,17 @@
+/*
+ * Python UUID module that wraps libuuid -
+ * DCE compatible Universally Unique Identifier library.
+ */
+
 #define PY_SSIZE_T_CLEAN
 
 #include "Python.h"
 #ifdef HAVE_UUID_UUID_H
 #include <uuid/uuid.h>
-#endif
-#ifdef HAVE_UUID_H
+#elif defined(HAVE_UUID_H)
 #include <uuid.h>
 #endif
 
-
 static PyObject *
 py_uuid_generate_time_safe(PyObject *Py_UNUSED(context),
                            PyObject *Py_UNUSED(ignored))



More information about the Python-checkins mailing list