1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 11:19:10 +00:00

More std::atomic and friends

This commit is contained in:
2014-04-08 21:38:46 -07:00
parent 23a071860e
commit 34b2eb1836
15 changed files with 61 additions and 94 deletions

View File

@ -489,19 +489,4 @@ void DebugMsg(const char* fmt, ...);
#define DEFAULT_FATAL(var) default: FATAL("No valid case for switch variable '" #var "'"); break;
#endif
/*****************************************************************************
*
* Atomic Operations
* FIXME: Replace with std::atomic when VS2012 supports WinXP
*
***/
#ifdef _MSC_VER
# define AtomicAdd(value, increment) InterlockedExchangeAdd(value, increment)
# define AtomicSet(value, set) InterlockedExchange(value, set)
#elif __GNUC__
# define AtomicAdd(value, increment) __sync_fetch_and_add(value, increment)
# define AtomicSet(value, set) __sync_lock_test_and_set(value, set)
#endif
#endif