World of Might and Magic
0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
|
См. документацию.
121 #if defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__)
123 #pragma intrinsic(_ReadWriteBarrier)
124 #define SDL_CompilerBarrier() _ReadWriteBarrier()
125 #elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
127 #define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
128 #elif defined(__WATCOMC__)
130 #pragma aux SDL_CompilerBarrier = "" parm [] modify exact [];
132 #define SDL_CompilerBarrier() \
133 { SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); }
158 #if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
159 #define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory")
160 #define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory")
161 #elif defined(__GNUC__) && defined(__aarch64__)
162 #define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
163 #define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
164 #elif defined(__GNUC__) && defined(__arm__)
173 #define SDL_MemoryBarrierRelease() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
174 #define SDL_MemoryBarrierAcquire() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
176 #include <sys/cpuinline.h>
178 #define SDL_MemoryBarrierRelease() __cpu_membarrier()
179 #define SDL_MemoryBarrierAcquire() __cpu_membarrier()
181 #if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__)
182 #define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
183 #define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
184 #elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__)
187 #define SDL_MEMORY_BARRIER_USES_FUNCTION
188 #define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction()
189 #define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction()
191 #define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
192 #define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
195 #define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory")
196 #define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory")
200 #if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
202 #include <mbarrier.h>
203 #define SDL_MemoryBarrierRelease() __machine_rel_barrier()
204 #define SDL_MemoryBarrierAcquire() __machine_acq_barrier()
207 #define SDL_MemoryBarrierRelease() SDL_CompilerBarrier()
208 #define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier()
251 #ifndef SDL_AtomicIncRef
252 #define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1)
261 #ifndef SDL_AtomicDecRef
262 #define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1)
DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock)
Lock a spin lock by setting it to a non-zero value.
DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a)
Get the value of an atomic variable.
DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock)
Try to lock a spin lock by setting it to a non-zero value.
DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v)
Set an atomic variable to a value.
DECLSPEC void *SDLCALL SDL_AtomicSetPtr(void **a, void *v)
Set a pointer to a value atomically.
DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v)
Add to an atomic variable.
DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval)
Set an atomic variable to a new value if it is currently an old value.
DECLSPEC void *SDLCALL SDL_AtomicGetPtr(void **a)
Get the value of a pointer atomically.
DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void)
DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void)
typedef void(SDLCALL *SDL_AudioFilter)(struct SDL_AudioCVT *cvt
A type representing an atomic integer value. It is a struct so people don't accidentally use numeric ...
DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval)
Set a pointer to a new value if it is currently an old value.
GLboolean GLboolean GLboolean GLboolean a
DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock)
Unlock a spin lock by setting it to 0. Always returns immediately.
void _ReadWriteBarrier(void)
void(* SDL_KernelMemoryBarrierFunc)()
_inline void SDL_CompilerBarrier(void)