summaryrefslogtreecommitdiff
path: root/src/stdatomic/atomic_exchange.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdatomic/atomic_exchange.c')
-rw-r--r--src/stdatomic/atomic_exchange.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/stdatomic/atomic_exchange.c b/src/stdatomic/atomic_exchange.c
new file mode 100644
index 00000000..f5124d18
--- /dev/null
+++ b/src/stdatomic/atomic_exchange.c
@@ -0,0 +1,6 @@
+#include <stdatomic.h>
+
+__BASE atomic_exchange(volatile __TYPE *object, __BASE desired)
+{
+ return *object = desired;
+}