diff --git a/numpy/core/setup_common.py b/numpy/core/setup_common.py index ba7521e3043b..a1729e656560 100644 --- a/numpy/core/setup_common.py +++ b/numpy/core/setup_common.py @@ -113,6 +113,7 @@ def check_api_version(apiversion, codegen_dir): "xmmintrin.h", # SSE "emmintrin.h", # SSE2 "features.h", # for glibc version linux + "xlocale.h" # see GH#8367 ] # optional gcc compiler builtins and their call arguments and optional a diff --git a/numpy/core/src/multiarray/numpyos.c b/numpy/core/src/multiarray/numpyos.c index 450ec40b6e0c..84617ea78c3d 100644 --- a/numpy/core/src/multiarray/numpyos.c +++ b/numpy/core/src/multiarray/numpyos.c @@ -15,7 +15,13 @@ #ifdef HAVE_STRTOLD_L #include -#include +#ifdef HAVE_XLOCALE_H + /* + * the defines from xlocale.h are included in locale.h on some sytems; + * see gh-8367 + */ + #include +#endif #endif