crt: Fix decoration for 32-bit x86 kernel32.def InterlockedPushListSList symbol
Function InterlockedPushListSList() is declared mingw-w64 header file
ntifs.h with fastcall calling convention and MS documentation says same:
https://learn.microsoft.com/en-us/windows/win32/sync/interlockedpushlistslist
Trying to compile simple code which uses InterlockedPushListSList()
#include <ntifs.h>
PSLIST_ENTRY func(PSLIST_HEADER ListHead, PSLIST_ENTRY List, PSLIST_ENTRY ListEnd, ULONG Count) {
return InterlockedPushListSList(ListHead, List, ListEnd, Count);
}
result in linking error:
/usr/bin/i686-w64-mingw32-ld: /tmp/ccSHmgvJ.o: in function `func':
/tmp/test20.c:2: undefined reference to `@InterlockedPushListSList@16'
collect2: error: ld returned 1 exit status
Change the stdcall mangling for InterlockedPushListSList symbol in file
lib32/kernel32.def to fastcall mangling. This fixes linking error.
Also MS Windows SDK in its Kernel32.lib has declared the
InterlockedPushListSList import symbol as fastcall:
@InterlockedPushListSList@16.
Signed-off-by: LIU Hao <lh_mouse@126.com>
1 file changed