forked from OSchip/llvm-project
python: silence macro redefinition warnings
Python defines _XOPEN_SOURCE and _POSIX_C_SOURCE unconditionally. On Linux, this is problematic as glibc's features.h defines these values if _GNU_SOURCE is defined to the value that is currently implemented. Python defines it to the versions that it requires, which may be different. Undefine the macros on Linux (technically, this should be safe to do globally) before including the python headers. llvm-svn: 208520
This commit is contained in:
parent
fba09d47e9
commit
f69b64d6d2
|
@ -18,6 +18,15 @@
|
|||
|
||||
#else
|
||||
|
||||
#if defined(__linux__)
|
||||
// features.h will define _POSIX_C_SOURCE if _GNU_SOURCE is defined. This value
|
||||
// may be different from the value that Python defines it to be which results
|
||||
// in a warning. Undefine _POSIX_C_SOURCE before including Python.h The same
|
||||
// holds for _XOPEN_SOURCE.
|
||||
#undef _POSIX_C_SOURCE
|
||||
#undef _XOPEN_SOURCE
|
||||
#endif
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
#endif // LLDB_DISABLE_PYTHON
|
||||
|
|
Loading…
Reference in New Issue