diff --git a/pandas/_libs/src/headers/portable.h b/pandas/_libs/src/headers/portable.h index cb8e5ba8138eb..3464fba963a5e 100644 --- a/pandas/_libs/src/headers/portable.h +++ b/pandas/_libs/src/headers/portable.h @@ -1,8 +1,16 @@ #ifndef _PANDAS_PORTABLE_H_ #define _PANDAS_PORTABLE_H_ +// To get `strdup` from strings.h +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE 600 +#endif + +#include + #if defined(_MSC_VER) #define strcasecmp( s1, s2 ) _stricmp( s1, s2 ) +#define strdup _strdup #endif // GH-23516 - works around locale perf issues diff --git a/pandas/_libs/src/ujson/lib/ultrajson.h b/pandas/_libs/src/ujson/lib/ultrajson.h index 71df0c5a186b7..5c851254815b7 100644 --- a/pandas/_libs/src/ujson/lib/ultrajson.h +++ b/pandas/_libs/src/ujson/lib/ultrajson.h @@ -54,6 +54,7 @@ tree doesn't have cyclic references. #include #include +#include "../../headers/portable.h" // Don't output any extra whitespaces when encoding #define JSON_NO_EXTRA_WHITESPACE