[Python-checkins] [2.7] bpo-31374: Include pyconfig.h earlier in expat (GH-11078)
Victor Stinner
webhook-mailer at python.org
Mon Dec 10 10:01:10 EST 2018
https://github.com/python/cpython/commit/2632df4c3f48f23af85a60bffc61030d52e83ee2
commit: 2632df4c3f48f23af85a60bffc61030d52e83ee2
branch: 2.7
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2018-12-10T16:01:03+01:00
summary:
[2.7] bpo-31374: Include pyconfig.h earlier in expat (GH-11078)
Include <pyconfig.h> ealier in Modules/expat/xmlparse.c to define
properly _POSIX_C_SOURCE and _XOPEN_SOURCE.
files:
M Modules/expat/xmlparse.c
M Modules/expat/xmltok.c
diff --git a/Modules/expat/xmlparse.c b/Modules/expat/xmlparse.c
index c4f3ffc215c9..2a763451a3ec 100644
--- a/Modules/expat/xmlparse.c
+++ b/Modules/expat/xmlparse.c
@@ -30,6 +30,9 @@
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#if !defined(_WIN32) && defined(HAVE_EXPAT_CONFIG_H)
+# include <pyconfig.h>
+#endif
#if !defined(_GNU_SOURCE)
# define _GNU_SOURCE 1 /* syscall prototype */
#endif
diff --git a/Modules/expat/xmltok.c b/Modules/expat/xmltok.c
index fa35de71324c..6371a350dadf 100644
--- a/Modules/expat/xmltok.c
+++ b/Modules/expat/xmltok.c
@@ -30,7 +30,9 @@
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include <pyconfig.h>
+#if !defined(_WIN32) && defined(HAVE_EXPAT_CONFIG_H)
+# include <pyconfig.h>
+#endif
#include <stddef.h>
#include <string.h> /* memcpy */
More information about the Python-checkins
mailing list