Skip to content

Commit abb5edb

Browse files
committed
check __STDC_VERSION__ for __STDC_NO_ATOMICS__
1 parent 420f2a7 commit abb5edb

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

lib/cluster.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !defined(__STDC_NO_ATOMICS__)
1+
#if __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_ATOMICS__)
22
#include <stdatomic.h>
33
#endif
44
#include <stdbool.h>

lib/exec_context.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !defined(__STDC_NO_ATOMICS__)
1+
#if __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_ATOMICS__)
22
#include <stdatomic.h>
33
#endif
44
#include <stdbool.h>

lib/mem.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <assert.h>
22
#include <errno.h>
3-
#if !defined(__STDC_NO_ATOMICS__)
3+
#if __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_ATOMICS__)
44
#include <stdatomic.h>
55
#endif
66
#include <stdbool.h>
@@ -14,7 +14,7 @@
1414

1515
#include "mem.h"
1616

17-
#if defined(__STDC_NO_ATOMICS__)
17+
#if __STDC_VERSION__ < 201112L || defined(__STDC_NO_ATOMICS__)
1818
static size_t
1919
atomic_fetch_sub(size_t *p, size_t diff)
2020
{

lib/platform.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
(a != 0 && (SIZE_MAX / a < b) ? 1 : (*c = a * b, 0))
178178
#endif
179179

180-
#if defined(__STDC_NO_ATOMICS__)
180+
#if __STDC_VERSION__ < 201112L || defined(__STDC_NO_ATOMICS__)
181181
#define _Atomic
182182
#define atomic_uint unsigned int
183183
#endif

0 commit comments

Comments
 (0)