summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2006-07-13 09:53:47 (GMT)
committerThomas Heller <theller@ctypes.org>2006-07-13 09:53:47 (GMT)
commitb4dc2ef5dacf833327f0db4b9acf8761e1f7b21b (patch)
treec21c7ef1064cc05a9b4c32aff2a1ccfeea3efc0d /Modules
parent9dceedbb97396e2c4959b6bb9f78eee0d9049283 (diff)
downloadcpython-b4dc2ef5dacf833327f0db4b9acf8761e1f7b21b.zip
cpython-b4dc2ef5dacf833327f0db4b9acf8761e1f7b21b.tar.gz
cpython-b4dc2ef5dacf833327f0db4b9acf8761e1f7b21b.tar.bz2
A misspelled preprocessor symbol caused ctypes to be always compiled
without thread support. Replaced WITH_THREADS with WITH_THREAD.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/_ctypes.c2
-rw-r--r--Modules/_ctypes/callbacks.c14
-rw-r--r--Modules/_ctypes/callproc.c6
3 files changed, 11 insertions, 11 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index dd5c717..2cbd5d5 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -4561,7 +4561,7 @@ init_ctypes(void)
ob_type is the metatype (the 'type'), defaults to PyType_Type,
tp_base is the base type, defaults to 'object' aka PyBaseObject_Type.
*/
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
PyEval_InitThreads();
#endif
m = Py_InitModule3("_ctypes", module_methods, module_docs);
diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c
index 9d08f1a..55ba5f0 100644
--- a/Modules/_ctypes/callbacks.c
+++ b/Modules/_ctypes/callbacks.c
@@ -127,7 +127,7 @@ static void _CallPythonObject(void *mem,
PyObject *result;
PyObject *arglist = NULL;
int nArgs;
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
PyGILState_STATE state = PyGILState_Ensure();
#endif
@@ -237,7 +237,7 @@ if (x == NULL) _AddTraceback(what, __FILE__, __LINE__ - 1), PyErr_Print()
Py_XDECREF(result);
Done:
Py_XDECREF(arglist);
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
PyGILState_Release(state);
#endif
}
@@ -400,16 +400,16 @@ STDAPI DllGetClassObject(REFCLSID rclsid,
LPVOID *ppv)
{
long result;
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
PyGILState_STATE state;
#endif
LoadPython();
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
state = PyGILState_Ensure();
#endif
result = Call_GetClassObject(rclsid, riid, ppv);
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
PyGILState_Release(state);
#endif
return result;
@@ -463,11 +463,11 @@ long Call_CanUnloadNow(void)
STDAPI DllCanUnloadNow(void)
{
long result;
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
PyGILState_STATE state = PyGILState_Ensure();
#endif
result = Call_CanUnloadNow();
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
PyGILState_Release(state);
#endif
return result;
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index 16e10de..0fe7d10 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -617,7 +617,7 @@ static int _call_function_pointer(int flags,
void *resmem,
int argcount)
{
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */
#endif
ffi_cif cif;
@@ -651,7 +651,7 @@ static int _call_function_pointer(int flags,
return -1;
}
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
if ((flags & FUNCFLAG_PYTHONAPI) == 0)
Py_UNBLOCK_THREADS
#endif
@@ -671,7 +671,7 @@ static int _call_function_pointer(int flags,
}
#endif
#endif
-#ifdef WITH_THREADS
+#ifdef WITH_THREAD
if ((flags & FUNCFLAG_PYTHONAPI) == 0)
Py_BLOCK_THREADS
#endif