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>
diff --git a/mingw-w64-crt/lib32/kernel32.def b/mingw-w64-crt/lib32/kernel32.def index 7443417..8d5fad7 100644 --- a/mingw-w64-crt/lib32/kernel32.def +++ b/mingw-w64-crt/lib32/kernel32.def
@@ -1553,7 +1553,7 @@ InitializeCriticalSectionEx@12 InitializeProcThreadAttributeList@16 InitializeSRWLock@4 -InterlockedPushListSList@8 +@InterlockedPushListSList@16 ; really fastcall calling convention IsCalendarLeapDay@20 IsCalendarLeapMonth@16 IsCalendarLeapYear@12