Maratyszcza / pthreadpool

Portable (POSIX/Windows/Emscripten) thread pool for C/C++
BSD 2-Clause "Simplified" License
350 stars 133 forks source link

Build error with WinSDK 10.0.16299.0 #11

Closed xkszltl closed 3 years ago

xkszltl commented 3 years ago

When building pthreadpool as part of pytorch on Windows, we got strange compile errors. Issue is originally filed in: https://github.com/pytorch/pytorch/issues/48895

The error message sounds like macro related. With some tests we found this issue is limited to WinSDK 16299 (I also tested 19041 and that works), and can be solve by defining WIN32_LEAN_AND_MEAN. I think it should be better to ask for fix in upstream, as guarding #define around #include <windows.h>.

Maratyszcza commented 3 years ago

I currently don't have a way to test on Windows, but if you create a PR, I'll merge it.