Skip to content

Commit

Permalink
disable atomic on msvc
Browse files Browse the repository at this point in the history
cmake log on github:

-- Building for: Visual Studio 17 2022
-- The C compiler identification is MSVC 19.40.33813.0

that version doesn't seem to have atomics.
https://devblogs.microsoft.com/cppblog/c11-atomics-in-visual-studio-2022-version-17-5-preview-2/
  • Loading branch information
yamt committed Aug 10, 2024
1 parent a1fa5d4 commit e2d0353
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@
(a != 0 && (SIZE_MAX / a < b) ? 1 : (*c = a * b, 0))
#endif

#if defined(MSVC)
#define _Atomic
#endif

#if !defined(__BEGIN_EXTERN_C)
#if defined(__cplusplus)
#define __BEGIN_EXTERN_C extern "C" {
Expand Down

0 comments on commit e2d0353

Please sign in to comment.