Path: blob/main/contrib/llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h
39638 views
//===-- lldb-python.h -------------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_LLDB_PYTHON_H9#define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_LLDB_PYTHON_H1011// BEGIN FIXME12// This declaration works around a clang module build failure.13// It should be deleted ASAP.14#include "llvm/Support/Error.h"15static llvm::Expected<bool> *g_fcxx_modules_workaround;16// END1718#include "lldb/Host/Config.h"1920// Python.h needs to be included before any system headers in order to avoid21// redefinition of macros2223#if LLDB_ENABLE_PYTHON24#include "llvm/Support/Compiler.h"25#if defined(_WIN32)26// If anyone #includes Host/PosixApi.h later, it will try to typedef pid_t. We27// need to ensure this doesn't happen. At the same time, Python.h will also try28// to redefine a bunch of stuff that PosixApi.h defines. So define it all now29// so that PosixApi.h doesn't redefine it.30#define NO_PID_T31#endif32#if defined(__linux__)33// features.h will define _POSIX_C_SOURCE if _GNU_SOURCE is defined. This value34// may be different from the value that Python defines it to be which results35// in a warning. Undefine _POSIX_C_SOURCE before including Python.h The same36// holds for _XOPEN_SOURCE.37#undef _POSIX_C_SOURCE38#undef _XOPEN_SOURCE39#endif4041// Include locale before Python so _PY_PORT_CTYPE_UTF8_ISSUE doesn't cause42// macro redefinitions.43#if defined(__APPLE__)44#include <locale>45#endif4647// Include python for non windows machines48#include <Python.h>49#endif5051#endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_LLDB_PYTHON_H525354