Maratyszcza / pthreadpool

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

Fix MSVC build #10

Closed peterjc123 closed 3 years ago

peterjc123 commented 4 years ago

According to https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=vs-2019, __STDC_VERSION__ is defined as 201112L when C++11 is enabled. But it doesn't provide stdatomic.h so let's disable this code path.

Maratyszcza commented 3 years ago

Clang-cl defines _MSC_VER and does include stdatomic.h, so the right guard is && (!defined(_MSC_VER) || defined(__clang__))

peterjc123 commented 3 years ago

@Maratyszcza Sounds reasonable.

peterjc123 commented 3 years ago

@Maratyszcza Fixed.