Blocked Single Lists (SList) with MinGW

When I try to port my Win32 code from the Microsoft toolchain to MinGW, most code compilers are fine, but there are a few exceptions. One API that seems to be missing from MinGW is the SList API (including InitializeSListHead, InterlockedPushEntrySList) - when I compile my sources, I get an error message about functions not defined. What can I do to make this API available in MinGW? Is there any Win32 SDK that I could update, or something like that?

+3
source share
3 answers

The current MinGW (based on GCC 4.6.2) already contains the SList API, but you need to specify what you are compiling for the Windows target that supports its defining preprocessor value _WIN32_WINNT = 0x0501 or higher (which indicates Windows Server 2003 Service Pack 1 (SP1 ), Windows XP Service Pack 2).

+4
source

Go to http://equation.com and download their perfect MinGW build using the latest gcc 4.8+

From winbase.h (in the MinGW / include equation):

#if defined(_SLIST_HEADER_) && !defined(_NTOSP_)
  WINBASEAPI VOID WINAPI InitializeSListHead(PSLIST_HEADER ListHead);
  WINBASEAPI PSLIST_ENTRY WINAPI InterlockedPopEntrySList(PSLIST_HEADER ListHead);
  WINBASEAPI PSLIST_ENTRY WINAPI InterlockedPushEntrySList(PSLIST_HEADER ListHead,PSLIST_ENTRY ListEntry);
  WINBASEAPI PSLIST_ENTRY WINAPI InterlockedFlushSList(PSLIST_HEADER ListHead);
  WINBASEAPI USHORT WINAPI QueryDepthSList(PSLIST_HEADER ListHead);
#endif /* _SLIST_HEADER_ && !_NTOSP_ */
0
source

QueryDepthSList();not in the headings 4.7.1. Other functions are.

0
source

All Articles