aboutsummaryrefslogtreecommitdiff
path: root/lib/darwin/interpose.c
diff options
context:
space:
mode:
authorcomex2015-07-16 16:12:35 -0400
committercomex2015-07-16 16:12:35 -0400
commit7af154d5573eda512ff5ebc3d4fcccf678c185fd (patch)
tree7c166bf00316045744e64bc2828e64dd5cf5589b /lib/darwin/interpose.c
parentsave/load state (diff)
downloadsubstitute-7af154d5573eda512ff5ebc3d4fcccf678c185fd.tar.gz
Revert <stdatomic.h> dependency.
it was added in the otherwise cosmetic dfd16cc1f759a103707ebd27743abc621486e131 because I didn't change the generated code at all - just switched to the standard aliases of the functions I was already using. But I forgot that <stdatomic.h> isn't present in relatively recent Xcode, so I'm switching back for now.
Diffstat (limited to 'lib/darwin/interpose.c')
-rw-r--r--lib/darwin/interpose.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/darwin/interpose.c b/lib/darwin/interpose.c
index 4581bab..b0e9923 100644
--- a/lib/darwin/interpose.c
+++ b/lib/darwin/interpose.c
@@ -2,7 +2,6 @@
#include <stdint.h>
#include <stdbool.h>
-#include <stdatomic.h>
#include "substitute.h"
#include "substitute-internal.h"
@@ -96,9 +95,8 @@ static int try_bind_section(void *bind, size_t size,
void *p = (void *) (segment + offset);
switch (type) {
case BIND_TYPE_POINTER: {
- old = atomic_exchange_explicit(
- (_Atomic uintptr_t *) p, new,
- memory_order_relaxed);
+ old = __atomic_exchange_n((uintptr_t *) p,
+ new, __ATOMIC_RELAXED);
break;
}
case BIND_TYPE_TEXT_ABSOLUTE32: {
@@ -107,9 +105,9 @@ static int try_bind_section(void *bind, size_t size,
* this is impossible... */
substitute_panic("bad TEXT_ABSOLUTE32 rel\n");
}
- old = atomic_exchange_explicit(
- (_Atomic uint32_t *) p, (uint32_t) new,
- memory_order_relaxed);
+ old = __atomic_exchange_n((uint32_t *) p,
+ (uint32_t) new,
+ __ATOMIC_RELAXED);
break;
}
case BIND_TYPE_TEXT_PCREL32: {
@@ -119,9 +117,9 @@ static int try_bind_section(void *bind, size_t size,
/* ditto */
substitute_panic("bad TEXT_ABSOLUTE32 rel\n");
}
- old = atomic_exchange_explicit(
- (_Atomic uint32_t *) p, (uint32_t) rel,
- memory_order_relaxed);
+ old = __atomic_exchange_n((uint32_t *) p,
+ (uint32_t) rel,
+ __ATOMIC_RELAXED);
old += pc;
break;
}