From 1695466fe3ec8f62176ec5c3793e580cfd4f3d5b Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sun, 23 Oct 2011 16:49:03 +0000 Subject: 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 --- lldb/source/Interpreter/ScriptInterpreterPython.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp') diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index 6b71c82b4e8e..70fb3f8237c1 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -8,8 +8,13 @@ //===----------------------------------------------------------------------===// // In order to guarantee correct working with Python, Python.h *MUST* be -// the *FIRST* header file included in ScriptInterpreterPython.h, and that -// must be the *FIRST* header file included here. +// the *FIRST* header file included here. + +#if defined (__APPLE__) +#include +#else +#include +#endif #include "lldb/Interpreter/ScriptInterpreterPython.h" @@ -242,11 +247,11 @@ ScriptInterpreterPython::~ScriptInterpreterPython () { while (!GetPythonLock (1)) fprintf (tmp_fh, "Python interpreter locked on another thread; waiting to acquire lock...\n"); - Py_DECREF (m_new_sysout); + Py_DECREF ((PyObject*)m_new_sysout); ReleasePythonLock (); } else - Py_DECREF (m_new_sysout); + Py_DECREF ((PyObject*)m_new_sysout); } } @@ -358,7 +363,7 @@ ScriptInterpreterPython::EnterSession () if ((m_new_sysout != NULL) && (sysmod != NULL) && (sysdict != NULL)) - PyDict_SetItemString (sysdict, "stdout", m_new_sysout); + PyDict_SetItemString (sysdict, "stdout", (PyObject*)m_new_sysout); if (PyErr_Occurred()) PyErr_Clear (); -- cgit v1.2.3