2010/8/17 Ozkan Sezer <seze...@gmail.com>:
> On Tue, Aug 17, 2010 at 2:24 PM, Kai Tietz <ktiet...@googlemail.com> wrote:
>> 2010/8/17 Pete Batard <pbat...@gmail.com>:
>>> For 32 bit, the current MinGW-w64 winbase has:
>>>
>>>   LONG InterlockedIncrement(LONG volatile *lpAddend);
>>>   LONG InterlockedDecrement(LONG volatile *lpAddend);
>>>   LONG InterlockedExchange(LONG volatile *Target,LONG Value);
>>>
>>> However, MinGW32 uses:
>>>
>>>   LONG WINAPI InterlockedDecrement(LONG volatile *);
>>>   LONG WINAPI InterlockedExchange(LONG volatile *,LONG);
>>>   LONG WINAPI InterlockedIncrement(LONG volatile *);
>>>
>>> The lack of WINAPI qualifier in MinGW-w64 results in MinGW-w64 32 bit
>>> objects lacking the __stdcall decoration (eg. '_interlockedexcha...@8'),
>>> which means that a 32 bit MinGW-w64 generated library using any of the
>>> Interlocked calls above cannot be used with MinGW32 environment.
>>>
>>> You might also want to note the following from the MinGW32 header
>>> regarding the Interlocked API section:
>>>
>>> /* CAREFUL: These are exported from ntoskrnl.exe and declared in
>>> winddk.h as __fastcall functions, but are exported from kernel32.dll as
>>> __stdcall */
>>>
>>> Regards,
>>>
>>> /Pete
>>
>> Thank you Pete for noticing that. We are aware of this and we solved
>> things here a bit different, but
>
> AFAIR, they aren't specifically marked as WINAPI in ms headers
> (well, maybe their mistake?..)

This isn't a mistake AFAIK. It is caused by the fact that the
Interlocked-API is for VC an intrinsic and in general intrinsics have
__decl calling convention (or special like __chkstk).
That kernel32 exports it as WINAPI is here caused by that fact that
all functions exported by kernel32 (and other OS platform DLLs) are
using __stdcall for 32-bit.

>>   maybe we could add here the stdcall
>> decoration, too. Our Interlocked API is treated in our libmingwex and
>> has here (as intrinsic) the __cdecl decoration.
>
> If we change into __stdcall we will be doing an api change within
> ourselves. This needs careful adjustments

Right, I am not sure if this is really the right way to go here.

>>  Therefore it shouldn't
>> produce for you in general issues.
>> Do you have here found issues while building?
>>
>> Regards,
>> Kai
>>
>
> --
> Ozkan
>

Kai

-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to