Fix building on macOS

macOS defines newlocale() in xlocale.h
This commit is contained in:
Kovid Goyal 2021-08-05 06:45:04 +05:30
parent 9e7253c179
commit 30cb7286db
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 1 deletions

View File

@ -18,7 +18,6 @@
// Needed for _NSGetProgname // Needed for _NSGetProgname
#include <crt_externs.h> #include <crt_externs.h>
#include <objc/runtime.h> #include <objc/runtime.h>
#include <xlocale.h>
#if (MAC_OS_X_VERSION_MAX_ALLOWED < 101200) #if (MAC_OS_X_VERSION_MAX_ALLOWED < 101200)
#define NSWindowStyleMaskResizable NSResizableWindowMask #define NSWindowStyleMaskResizable NSResizableWindowMask

View File

@ -11,6 +11,7 @@
#include <unistd.h> #include <unistd.h>
#undef _DARWIN_C_SOURCE #undef _DARWIN_C_SOURCE
#endif #endif
#include "data-types.h" #include "data-types.h"
#include "cleanup.h" #include "cleanup.h"
#include "safe-wrappers.h" #include "safe-wrappers.h"
@ -24,13 +25,16 @@
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <locale.h> #include <locale.h>
#ifdef WITH_PROFILER #ifdef WITH_PROFILER
#include <gperftools/profiler.h> #include <gperftools/profiler.h>
#endif #endif
#include "monotonic.h" #include "monotonic.h"
#ifdef __APPLE__ #ifdef __APPLE__
#include <libproc.h> #include <libproc.h>
#include <xlocale.h>
static PyObject* static PyObject*
user_cache_dir() { user_cache_dir() {