include: Always add defines for the Interlocked* functions.

Alexandre Julliard julliard at winehq.org
Fri Oct 15 01:57:57 CDT 2021


Jacek Caban <jacek at codeweavers.com> writes:

> Hi Alexandre,
>
>
>> -static FORCEINLINE LONG WINAPI InterlockedIncrement( LONG volatile
>    *dest )
>> -{
>> -    return _InterlockedIncrement( (long volatile *)dest );
>> -}
>
>
> What was wrong with those inlines? Note that the commit removes LONG*
> to long* casts and causes warnings on clang msvc target.

They need to be defines, for instance libxml2 does this:

#ifdef InterlockedCompareExchangePointer
        InterlockedCompareExchangePointer((void **) &global_init_lock,
                                          cs, NULL);
#else /* Use older void* version */
        InterlockedCompareExchange((void **) &global_init_lock,
                                   (void *) cs, NULL);
#endif /* InterlockedCompareExchangePointer */

which will break on 64-bit. We could of course change only that one, but
they are all #defines in the MS headers.

I think that a better fix would be to use the correct types for LONG
etc. on PE targets.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list