To: vim-dev@vim.org Subject: Patch 6.2.305 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.305 (after 6.2.300) Problem: Win32: Cannot build Python interface with Python 2.3. (Ajit Thakkar) Solution: Add two functions to the dynamic loading feature. Files: src/if_python.c *** ../vim-6.2.304/src/if_python.c Mon Mar 1 10:34:00 2004 --- src/if_python.c Mon Mar 1 20:02:36 2004 *************** *** 62,67 **** --- 62,72 ---- #define file_input 257 #define eval_input 258 + #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x020300F0 + /* Python 2.3: can invoke ":python" recursively. */ + # define PY_CAN_RECURSE + #endif + #if defined(DYNAMIC_PYTHON) || defined(PROTO) # ifndef DYNAMIC_PYTHON # define HINSTANCE int /* for generating prototypes */ *************** *** 82,87 **** --- 87,96 ---- # define PyEval_InitThreads dll_PyEval_InitThreads # define PyEval_RestoreThread dll_PyEval_RestoreThread # define PyEval_SaveThread dll_PyEval_SaveThread + # ifdef PY_CAN_RECURSE + # define PyGILState_Ensure dll_PyGILState_Ensure + # define PyGILState_Release dll_PyGILState_Release + # endif # define PyInt_AsLong dll_PyInt_AsLong # define PyInt_FromLong dll_PyInt_FromLong # define PyInt_Type (*dll_PyInt_Type) *************** *** 132,137 **** --- 141,150 ---- static void(*dll_PyEval_InitThreads)(void); static void(*dll_PyEval_RestoreThread)(PyThreadState *); static PyThreadState*(*dll_PyEval_SaveThread)(void); + # ifdef PY_CAN_RECURSE + static PyGILState_STATE (*dll_PyGILState_Ensure)(void); + static void (*dll_PyGILState_Release)(PyGILState_STATE); + #endif static long(*dll_PyInt_AsLong)(PyObject *); static PyObject*(*dll_PyInt_FromLong)(long); static PyTypeObject* dll_PyInt_Type; *************** *** 204,209 **** --- 217,226 ---- {"PyEval_InitThreads", (PYTHON_PROC*)&dll_PyEval_InitThreads}, {"PyEval_RestoreThread", (PYTHON_PROC*)&dll_PyEval_RestoreThread}, {"PyEval_SaveThread", (PYTHON_PROC*)&dll_PyEval_SaveThread}, + # ifdef PY_CAN_RECURSE + {"PyGILState_Ensure", (PYTHON_PROC*)&dll_PyGILState_Ensure}, + {"PyGILState_Release", (PYTHON_PROC*)&dll_PyGILState_Release}, + # endif {"PyInt_AsLong", (PYTHON_PROC*)&dll_PyInt_AsLong}, {"PyInt_FromLong", (PYTHON_PROC*)&dll_PyInt_FromLong}, {"PyInt_Type", (PYTHON_PROC*)&dll_PyInt_Type}, *************** *** 363,372 **** typedef PyObject PyThreadState; #endif /* Python 1.4 */ ! #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x020300F0 ! /* Python 2.3: can invoke ":python" recursively. */ ! # define PY_CAN_RECURSE ! #else static PyThreadState* saved_python_thread = NULL; /* --- 380,386 ---- typedef PyObject PyThreadState; #endif /* Python 1.4 */ ! #ifndef PY_CAN_RECURSE static PyThreadState* saved_python_thread = NULL; /* *** ../vim-6.2.304/src/version.c Mon Mar 1 17:11:04 2004 --- src/version.c Mon Mar 1 20:06:31 2004 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 305, /**/ -- A mathematician is a device for turning coffee into theorems. Paul Erdos A computer programmer is a device for turning coffee into bugs. Bram Moolenaar /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///