summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-12-10 16:01:03 +0100
committerGitHub <noreply@github.com>2018-12-10 16:01:03 +0100
commit2632df4c3f48f23af85a60bffc61030d52e83ee2 (patch)
tree31d3f708c3d601d59e97d7205199b7fbb8d11dd8 /Modules
parent1fd93ff18cf5cc324c743564ea2347bef06c0de0 (diff)
downloadcpython-git-2632df4c3f48f23af85a60bffc61030d52e83ee2.tar.gz
[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.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/expat/xmlparse.c3
-rw-r--r--Modules/expat/xmltok.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/Modules/expat/xmlparse.c b/Modules/expat/xmlparse.c
index c4f3ffc215..2a763451a3 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 fa35de7132..6371a350da 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 */