Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions bundles/org.eclipse.swt/Eclipse SWT/common/library/callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@

static CALLBACK_DATA callbackData[MAX_CALLBACKS];
static int callbackEnabled = 1;
#ifdef ATOMIC
#include <stdatomic.h>
static _Atomic int callbackEntryCount = 0;
#else
static int callbackEntryCount = 0;
#endif
static int initialized = 0;
static jmethodID mid_Throwable_addSuppressed = NULL;

Expand All @@ -45,9 +50,8 @@ static jmethodID mid_Throwable_addSuppressed = NULL;
#endif

#ifdef ATOMIC
#include <libkern/OSAtomic.h>
#define ATOMIC_INC(value) OSAtomicIncrement32(&value);
#define ATOMIC_DEC(value) OSAtomicDecrement32(&value);
#define ATOMIC_INC(value) atomic_fetch_add_explicit(&value, 1, memory_order_relaxed);
#define ATOMIC_DEC(value) atomic_fetch_sub_explicit(&value, 1, memory_order_relaxed);
#else
#define ATOMIC_INC(value) value++;
#define ATOMIC_DEC(value) value--;
Expand Down
Loading