pass over atomic operations

- use cast to volatile trick for atomic loads on x64 windows
- removed unnecessary includes on windows
- upgraded clang and gcc code paths to use modern atomics

Removed WIN32_LEAN_AND_MEAN because we were already compiling without it
and there is code path in os_gfx_win32.c that relies on including full
windows.h
This commit is contained in:
Nikita Smith
2024-10-29 16:31:41 -07:00
parent eba6765541
commit e085dae636
3 changed files with 36 additions and 40 deletions
-10
View File
@@ -23,16 +23,6 @@
#define BitExtract(x, count, shift) (((x) >> (shift)) & ((1 << (count)) - 1))
////////////////////////////////
#if OS_WINDOWS
# define ins_atomic_ptr_eval_cond_assign(x,k,c) InterlockedCompareExchangePointer((volatile PVOID *)(x),(k),(c))
# define ins_atomic_u32_add_eval(x,c) InterlockedAdd((volatile LONG *)(x), c)
# define ins_atomic_u32_inc_eval(x) InterlockedIncrement((volatile LONG *)x)
#else
# error "atomics are not defined for this system"
#endif
////////////////////////////////
// Linked List Helpers