summaryrefslogtreecommitdiff
path: root/lib/frratomic.h
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2018-08-29 15:39:19 -0400
committerMark Stapp <mjs@voltanet.io>2018-08-29 15:39:19 -0400
commit1ed98c2db620b0831d23407ae461156e07c378fc (patch)
tree601f9087b921df1865bb08daa58bc53e605c30f6 /lib/frratomic.h
parent7e678379edb62b1a2e75131ef3a9fae701fbcc37 (diff)
libs: fix missing atomics for some gcc versions
stdatomic.h does not have aliases for all of the useful gcc atomic primitives; add them in for that path through frratomic.h. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'lib/frratomic.h')
-rw-r--r--lib/frratomic.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/frratomic.h b/lib/frratomic.h
index 113f46c075..1f1d1b569a 100644
--- a/lib/frratomic.h
+++ b/lib/frratomic.h
@@ -29,6 +29,12 @@
#ifdef HAVE_STDATOMIC_H
#include <stdatomic.h>
+/* These are available in gcc, but not in stdatomic */
+#define atomic_add_fetch_explicit __atomic_add_fetch
+#define atomic_sub_fetch_explicit __atomic_sub_fetch
+#define atomic_and_fetch_explicit __atomic_and_fetch
+#define atomic_or_fetch_explicit __atomic_or_fetch
+
/* gcc 4.7 and newer */
#elif defined(HAVE___ATOMIC)