power_play/src/atomic.h
2024-02-29 16:01:51 -06:00

19 lines
360 B
C

#ifndef ATOMICS_H
#define ATOMICS_H
#if OS_WINDOWS
/* winnt.h declarations */
i64 _InterlockedIncrement64(i64 volatile *addend);
i64 _InterlockedDecrement64(i64 volatile *addend);
#define atomic_inc_eval64(ptr) _InterlockedIncrement64(ptr)
#define atomic_dec_eval64(ptr) _InterlockedDecrement64(ptr)
#else
# error "Atomics not implemented"
#endif
#endif