16 #if defined(AJA_WINDOWS)
18 #pragma warning(disable: 4311)
19 #pragma warning(disable: 4312)
20 return (
void*)InterlockedExchangePointer((
void*
volatile*)pTarget, (
void*)pValue);
24 #if defined(AJA_LINUX) || defined(AJA_MAC)
25 return __sync_lock_test_and_set(pTarget, pValue);
33 #if defined(AJA_WINDOWS)
34 return (int32_t)InterlockedExchange((LONG
volatile*)pTarget, (LONG)value);
37 #if defined(AJA_LINUX) || defined(AJA_MAC)
38 return __sync_lock_test_and_set(pTarget, value);
46 #if defined(AJA_WINDOWS)
47 return (uint32_t)InterlockedExchange((LONG
volatile*)pTarget, (LONG)value);
50 #if defined(AJA_LINUX) || defined(AJA_MAC)
51 return __sync_lock_test_and_set(pTarget, value);
59 #if defined(AJA_WINDOWS)
60 return (int64_t)InterlockedExchange64((LONGLONG
volatile*)pTarget, (LONGLONG)value);
63 #if defined(AJA_LINUX) || defined(AJA_MAC)
64 return __sync_lock_test_and_set(pTarget, value);
72 #if defined(AJA_WINDOWS)
73 return (uint64_t)InterlockedExchange64((LONGLONG
volatile*)pTarget, (LONGLONG)value);
76 #if defined(AJA_LINUX) || defined(AJA_MAC)
77 return __sync_lock_test_and_set(pTarget, value);
85 #if defined(AJA_WINDOWS)
86 return (int32_t)InterlockedIncrement((LONG
volatile*)pTarget);
89 #if defined(AJA_LINUX) || defined(AJA_MAC)
90 return __sync_add_and_fetch(pTarget, 1);
98 #if defined(AJA_WINDOWS)
99 return (int32_t)InterlockedDecrement((LONG
volatile*)pTarget);
102 #if defined(AJA_LINUX) || defined(AJA_MAC)
103 return __sync_sub_and_fetch(pTarget, 1);
111 #if defined(AJA_WINDOWS)
112 return (uint32_t)InterlockedIncrement((LONG
volatile*)pTarget);
115 #if defined(AJA_LINUX) || defined(AJA_MAC)
116 return __sync_add_and_fetch(pTarget, 1);
124 #if defined(AJA_WINDOWS)
125 return (uint32_t)InterlockedDecrement((LONG
volatile*)pTarget);
128 #if defined(AJA_LINUX) || defined(AJA_MAC)
129 return __sync_sub_and_fetch(pTarget, 1);
137 #if defined(AJA_WINDOWS)
138 return (int64_t)InterlockedIncrement64((LONGLONG
volatile*)pTarget);
141 #if defined(AJA_LINUX) || defined(AJA_MAC)
142 return __sync_add_and_fetch(pTarget, 1);
150 #if defined(AJA_WINDOWS)
151 return (int64_t)InterlockedDecrement64((LONGLONG
volatile*)pTarget);
154 #if defined(AJA_LINUX) || defined(AJA_MAC)
155 return __sync_sub_and_fetch(pTarget, 1);
163 #if defined(AJA_WINDOWS)
164 return (uint64_t)InterlockedIncrement64((LONGLONG
volatile*)pTarget);
167 #if defined(AJA_LINUX) || defined(AJA_MAC)
168 return __sync_add_and_fetch(pTarget, 1);
176 #if defined(AJA_WINDOWS)
177 return (uint64_t)InterlockedDecrement64((LONGLONG
volatile*)pTarget);
180 #if defined(AJA_LINUX) || defined(AJA_MAC)
181 return __sync_sub_and_fetch(pTarget, 1);