[Patches] [ python-Patches-500981 ] thread_nt.h weird prototype

noreply@sourceforge.net noreply@sourceforge.net
Tue, 08 Jan 2002 11:45:03 -0800


Patches item #500981, was opened at 2002-01-08 11:44
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=500981&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jason Orendorff (jorend)
Assigned to: Nobody/Anonymous (nobody)
Summary: thread_nt.h weird prototype

Initial Comment:
Python/thread_nt.h gives a prototype of 
InterlockedCompareExchange that (strangely) disagrees 
with the MSDN definition of the API.

In python/dist/src/Python/thread_nt.h, line 19:
  typedef PVOID WINAPI interlocked_cmp_xchg_t(PVOID 
*dest, PVOID exc, PVOID comperand) ;

But:
  // According to MSDN
  LONG InterlockedCompareExchange( 
    LPLONG volatile Destination,  // destination 
address
    LONG Exchange,                // exchange value
    LONG Comperand                // value to compare
  );

Later on in the file, when the function actually gets 
called, the code contains a bunch of casts to 
compensate for the fact that the prototype is wrong!  
How weird is that?

I've attached a patch that fixes the wacky prototype 
in question.  (I built Python with it and ran the 
regression tests; everything works.)


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=500981&group_id=5470