diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-10-23 16:49:03 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-10-23 16:49:03 +0000 |
commit | 1695466fe3ec8f62176ec5c3793e580cfd4f3d5b (patch) | |
tree | 718dca4a06d30b313df033fa5498537b5040c077 /lldb/source/Core/FormatClasses.cpp | |
parent | d34a329c6843aca1f15d450d33530d6b4ca4e344 (diff) | |
download | bcm5719-llvm-1695466fe3ec8f62176ec5c3793e580cfd4f3d5b.tar.gz bcm5719-llvm-1695466fe3ec8f62176ec5c3793e580cfd4f3d5b.zip |
Move Python.h includes out of the headers into the .cpp file where it's actually used.
Python.h includes a ton of macros that can cause weird behavior down the road.
llvm-svn: 142754
Diffstat (limited to 'lldb/source/Core/FormatClasses.cpp')
-rw-r--r-- | lldb/source/Core/FormatClasses.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lldb/source/Core/FormatClasses.cpp b/lldb/source/Core/FormatClasses.cpp index abfb7fdd553..ef067344480 100644 --- a/lldb/source/Core/FormatClasses.cpp +++ b/lldb/source/Core/FormatClasses.cpp @@ -8,6 +8,11 @@ //===----------------------------------------------------------------------===// // C Includes +#if defined (__APPLE__) +#include <Python/Python.h> +#else +#include <Python.h> +#endif // C++ Includes #include <ostream> @@ -243,7 +248,12 @@ SyntheticScriptProvider::FrontEnd::FrontEnd(std::string pclass, if (m_interpreter == NULL) m_wrapper = NULL; else - m_wrapper = (PyObject*)m_interpreter->CreateSyntheticScriptedProvider(m_python_class, m_backend); + m_wrapper = m_interpreter->CreateSyntheticScriptedProvider(m_python_class, m_backend); +} + +SyntheticScriptProvider::FrontEnd::~FrontEnd() +{ + Py_XDECREF((PyObject*)m_wrapper); } lldb::ValueObjectSP |