Skip to content

Commit 4e9fc3b

Browse files
committed
rtapi: fix wrong STDC macro and warn when compiler is older than C11.
1 parent 4950963 commit 4e9fc3b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/rtapi/rtapi_atomic.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818

1919
#if defined(__GNUC__) && ((__GNUC__ << 8) | __GNUC_MINOR__) >= 0x409
2020
#define RTAPI_USE_STDATOMIC
21-
#elif defined(__STDC_VERSION__) && __STDC_VERSION > 201112L
21+
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2222
#define RTAPI_USE_STDATOMIC
2323
#endif
2424

2525
#ifdef RTAPI_USE_STDATOMIC
2626
#include <stdatomic.h>
2727
#else
2828

29+
#warning "Old compiler has no C11 atomics. Please consider upgrading your compiler."
30+
2931
enum memory_order {
3032
memory_order_relaxed,
3133
memory_order_consume,

0 commit comments

Comments
 (0)