]> granicus.if.org Git - python/commitdiff
A misspelled preprocessor symbol caused ctypes to be always compiled
authorThomas Heller <theller@ctypes.org>
Thu, 13 Jul 2006 09:53:47 +0000 (09:53 +0000)
committerThomas Heller <theller@ctypes.org>
Thu, 13 Jul 2006 09:53:47 +0000 (09:53 +0000)
without thread support.  Replaced WITH_THREADS with WITH_THREAD.

Misc/NEWS
Modules/_ctypes/_ctypes.c
Modules/_ctypes/callbacks.c
Modules/_ctypes/callproc.c

index e12f07fd59716a7f05d4606346fba7acdd6cfb84..516e84ccf4d8a9f9b26a07927861c2fa229fff6b 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -28,6 +28,9 @@ Extension Modules
 - Bug #1467450: On Mac OS X 10.3, RTLD_GLOBAL is now used as the
   default mode for loading shared libraries in ctypes.
 
+- Because of a misspelled preprocessor symbol, ctypes was always
+  compiled without thread support; this is now fixed.
+
 What's New in Python 2.5 beta 2?
 ================================
 
index dd5c717bb5fe881742e37d99b73a7aa232f0903f..2cbd5d593baa37a548e52496d2c577a7dad925bc 100644 (file)
@@ -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);
index 9d08f1a3dc3207b253985b26b9013e53148ccb3c..55ba5f0c0b3059220d3441848e94b7128ac84cb3 100644 (file)
@@ -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;
index 16e10dedad2e6635b7064e462dc7927fffb2f985..0fe7d103ffc10f5b8ba97e32ea1d97d4ec9f4e28 100644 (file)
@@ -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