meganz/mingw-std-threads

Fails to build when tarrgeting WinRT / Windows Store apps

Closed this issue · 1 comments

$ cat test.cpp 
#include "mingw.thread.h"
int main() {
    return 0;
}
$ i686-w64-mingw32-g++-win32 -DWINAPI_FAMILY=0x2 -D_WIN32_WINNT=0x0602 test.cpp 
In file included from test.cpp:1:0:
mingw.thread.h: In static member function ‘static unsigned int mingw_stdthread::thread::_hardware_concurrency_helper()’:
mingw.thread.h:266:9: error: ‘::GetSystemInfo’ has not been declared
         ::GetSystemInfo(&sysinfo);
         ^~

GetSystemInfo() is not available for WINAPI_FAMILY=0x2.
GetNativeSystemInfo() is however available and provides the identical information, and also works when targeting standard desktop.

Please replace GetSystemInfo with GetNativeSystemInfo.

Note that GetNativeSystemInfo requires _WIN32_WINNT >= 0x501 (>= Windows XP). Thus, if mingw-std-threads still wants to support pre Windows XP, this requires an #if.

Fixed by #40 .