Bug 89 - InterlockedCompareExchange has incorrect signature in winbase.h
Summary: InterlockedCompareExchange has incorrect signature in winbase.h
Status: NEW
Alias: None
Product: C/C++ compiler
Classification: Unclassified
Component: dmc (show other bugs)
Version: unspecified
Hardware: PC Windows
: P5 normal
Assignee: Walter Bright
URL:
Depends on:
Blocks:
 
Reported: 2011-04-10 11:44 UTC by Jesse Phillips
Modified: 2011-04-10 11:45 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Phillips 2011-04-10 11:44:24 UTC
According to MSDN
http://msdn.microsoft.com/en-us/library/ms683560%28v=vs.85%29.aspx

The signature is:

LONG __cdecl InterlockedCompareExchange(
  __inout  LONG volatile *Destination,
  __in     LONG Exchange,
  __in     LONG Comparand
);

However winbase.h is defined with PVOID types:

PVOID
WINAPI
InterlockedCompareExchange (
    PVOID *Destination,
    PVOID Exchange,
    PVOID Comperand
    );

This is however the correct signature for InterlockedCompareExchangePointer which is not found in the header file.
http://msdn.microsoft.com/en-us/library/ms683568%28v=vs.85%29.aspx