diff options
-rw-r--r-- | xbmc/lib/libPython/XBPythonDll.cpp | 21 | ||||
-rw-r--r-- | xbmc/lib/libPython/XBPythonDllFuncs.S | 15 |
2 files changed, 33 insertions, 3 deletions
diff --git a/xbmc/lib/libPython/XBPythonDll.cpp b/xbmc/lib/libPython/XBPythonDll.cpp index 94b2f5857d..d260536647 100644 --- a/xbmc/lib/libPython/XBPythonDll.cpp +++ b/xbmc/lib/libPython/XBPythonDll.cpp @@ -19,6 +19,23 @@ * */ +#if (defined HAVE_CONFIG_H) && (!defined WIN32) + #include "config.h" +#endif +#if (defined USE_EXTERNAL_PYTHON) + #if (defined HAVE_LIBPYTHON2_6) + #include <python2.6/pyconfig.h> + #elif (defined HAVE_LIBPYTHON2_5) + #include <python2.5/pyconfig.h> + #elif (defined HAVE_LIBPYTHON2_4) + #include <python2.4/pyconfig.h> + #else + #error "Could not determine version of Python to use." + #endif +#else + #include "Python/Include/pyconfig.h" +#endif + #include "XBPythonDll.h" #include "cores/DllLoader/DllLoader.h" @@ -80,7 +97,7 @@ extern "C" FUNCTION(PyLong_AsLong) FUNCTION(PyLong_AsLongLong) FUNCTION(PyErr_Format) -#if !defined(_LINUX) +#if Py_UNICODE_SIZE == 2 FUNCTION(PyUnicodeUCS2_AsUnicode) #else FUNCTION(PyUnicodeUCS4_AsUnicode) @@ -193,7 +210,7 @@ extern "C" dll.ResolveExport(DLL_FUNCTION(PyLong_AsLong)) && dll.ResolveExport(DLL_FUNCTION(PyLong_AsLongLong)) && dll.ResolveExport(DLL_FUNCTION(PyErr_Format)) && -#if !defined(_LINUX) +#if Py_UNICODE_SIZE == 2 dll.ResolveExport(DLL_FUNCTION(PyUnicodeUCS2_AsUnicode)) && #else dll.ResolveExport(DLL_FUNCTION(PyUnicodeUCS4_AsUnicode)) && diff --git a/xbmc/lib/libPython/XBPythonDllFuncs.S b/xbmc/lib/libPython/XBPythonDllFuncs.S index b3131c7311..5050af8d06 100644 --- a/xbmc/lib/libPython/XBPythonDllFuncs.S +++ b/xbmc/lib/libPython/XBPythonDllFuncs.S @@ -1,6 +1,19 @@ #if (defined HAVE_CONFIG_H) && (!defined WIN32) #include "config.h" #endif +#if (defined USE_EXTERNAL_PYTHON) + #if (defined HAVE_LIBPYTHON2_6) + #include <python2.6/pyconfig.h> + #elif (defined HAVE_LIBPYTHON2_5) + #include <python2.5/pyconfig.h> + #elif (defined HAVE_LIBPYTHON2_4) + #include <python2.4/pyconfig.h> + #else + #error "Could not determine version of Python to use." + #endif +#else + #include "Python/Include/pyconfig.h" +#endif #ifndef __arm__ #ifndef __APPLE__ #if defined(__PPC__) @@ -85,7 +98,7 @@ FUNCTION(PyLong_AsLong) FUNCTION(PyLong_AsLongLong) FUNCTION(PyErr_Format) -#if !defined(_LINUX) +#if Py_UNICODE_SIZE == 2 FUNCTION(PyUnicodeUCS2_AsUnicode) #else FUNCTION(PyUnicodeUCS4_AsUnicode) |