converted my gen_utils.h fix to PyObjectPlus.h

Also added a fix for PyMarshal_WriteObjectToString

Now I just need to figure out linking of the gameengine on my imac.

Kent
This commit is contained in:
Kent Mein
2008-09-06 14:13:31 +00:00
parent 810f799660
commit 115cf18bed
25 changed files with 50 additions and 24 deletions

View File

@@ -717,7 +717,11 @@ void GPG_Application::stopEngine()
if (gameLogic) {
PyObject* pyGlobalDict = PyDict_GetItemString(PyModule_GetDict(gameLogic), "globalDict"); // Same as importing the module
if (pyGlobalDict) {
#ifdef Py_MARSHAL_VERSION
PyObject* pyGlobalDictMarshal = PyMarshal_WriteObjectToString( pyGlobalDict, 2); // Py_MARSHAL_VERSION == 2 as of Py2.5
#else
PyObject* pyGlobalDictMarshal = PyMarshal_WriteObjectToString( pyGlobalDict );
#endif
if (pyGlobalDictMarshal) {
m_pyGlobalDictString_Length = PyString_Size(pyGlobalDictMarshal);
PyObject_Print(pyGlobalDictMarshal, stderr, 0);