[Python-checkins] r50713 - python/trunk/Modules/_ctypes/callbacks.c python/trunk/Modules/_ctypes/callproc.c

Thomas Heller theller at python.net
Wed Jul 19 15:38:17 CEST 2006


Andrew MacIntyre schrieb:
> thomas.heller wrote:
[...]
>> Modified: python/trunk/Modules/_ctypes/callproc.c
>> ==============================================================================
>> --- python/trunk/Modules/_ctypes/callproc.c	(original)
>> +++ python/trunk/Modules/_ctypes/callproc.c	Wed Jul 19 11:09:32 2006
>> @@ -818,7 +818,9 @@
>>  	/* We absolutely have to release the GIL during COM method calls,
>>  	   otherwise we may get a deadlock!
>>  	*/
>> +#ifdef WITH_THREAD
>>  	Py_BEGIN_ALLOW_THREADS
>> +#endif
>>  
>>  	hr = pIunk->lpVtbl->QueryInterface(pIunk, &IID_ISupportErrorInfo, (void **)&psei);
>>  	if (FAILED(hr))
>> @@ -842,7 +844,9 @@
>>  	pei->lpVtbl->Release(pei);
>>  
>>    failed:
>> +#ifdef WITH_THREAD
>>  	Py_END_ALLOW_THREADS
>> +#endif
>>  
>>  	progid = NULL;
>>  	ProgIDFromCLSID(&guid, &progid);
> 
> Umm... the Py_[BEGIN|END]_ALLOW_THREADS macros shouldn't need to be
> #ifdef'ed like this surely?  There's already an #ifdef WITH_THREAD in
> Include/ceval.h to (hopefully) correctly redefine them appropriately.
> 

Ideally, yes.  However, in this case, MSVC complains about a syntax error:
missing ';' before '}', or something like that.  Py_END_ALLOW_THREADS
expands to '}' when WITH_THREAD is not defined.  Maybe the label immediately
before the end of a block is not valid.

I haven't tried if inserting a ';' after the failed: label will repair this.

Thomas



More information about the Python-checkins mailing list