1 //===-- lldb-python.h -------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_LLDB_PYTHON_H
11 #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_LLDB_PYTHON_H
13 // Python.h needs to be included before any system headers in order to avoid
14 // redefinition of macros
16 #ifdef LLDB_DISABLE_PYTHON
17 // Python is disabled in this build
19 #include "llvm/Support/Compiler.h"
21 // If anyone #includes Host/PosixApi.h later, it will try to typedef pid_t. We
22 // need to ensure this doesn't happen. At the same time, Python.h will also try
23 // to redefine a bunch of stuff that PosixApi.h defines. So define it all now
24 // so that PosixApi.h doesn't redefine it.
27 #if defined(__linux__)
28 // features.h will define _POSIX_C_SOURCE if _GNU_SOURCE is defined. This value
29 // may be different from the value that Python defines it to be which results
30 // in a warning. Undefine _POSIX_C_SOURCE before including Python.h The same
31 // holds for _XOPEN_SOURCE.
32 #undef _POSIX_C_SOURCE
36 // Include python for non windows machines
38 #endif // LLDB_DISABLE_PYTHON
40 #endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_LLDB_PYTHON_H