From fa19b6146e1fab8e13322a773871cc7e1a81b080 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 15 Sep 2017 15:42:07 +0200 Subject: [PATCH] bpo-31374: undef _POSIX_C_SOURCE in expat_config.h Undefine _POSIX_C_SOURCE in Modules/expat/expat_config.h to fix a compiler warning. --- Modules/expat/expat_config.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Modules/expat/expat_config.h b/Modules/expat/expat_config.h index b8c1639b9769ab..742b4e9c127539 100644 --- a/Modules/expat/expat_config.h +++ b/Modules/expat/expat_config.h @@ -5,7 +5,16 @@ #ifndef EXPAT_CONFIG_H #define EXPAT_CONFIG_H +/* bpo-31374: Expat defines _POSIX_C_SOURCE before including expat_config.h, + but pyconfig.h redefines _POSIX_C_SOURCE on some platforms. Unset it to + prevent a compiler warning. */ +#ifdef _POSIX_C_SOURCE +# undef _POSIX_C_SOURCE +#endif + +/* Get WORDS_BIGENDIAN and HAVE_MEMMOVE defines from pyconfig.h */ #include + #ifdef WORDS_BIGENDIAN #define BYTEORDER 4321 #else