diff options
| author | Garrett D'Amore <garrett@damore.org> | 2019-06-27 20:46:22 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2019-06-27 20:46:22 -0700 |
| commit | cdedbcd904a3fadce10aecb4fbba5f293099be65 (patch) | |
| tree | 45b906e6c15b74166682436fa6dfd8c4804d0017 /src/platform | |
| parent | 08803681fa85fa4bd5b24360203127d6ad70919e (diff) | |
| download | nng-cdedbcd904a3fadce10aecb4fbba5f293099be65.tar.gz nng-cdedbcd904a3fadce10aecb4fbba5f293099be65.tar.bz2 nng-cdedbcd904a3fadce10aecb4fbba5f293099be65.zip | |
MinGW fixes for interlocked variables
Diffstat (limited to 'src/platform')
| -rw-r--r-- | src/platform/windows/win_thread.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/platform/windows/win_thread.c b/src/platform/windows/win_thread.c index 146520e9..076da9e4 100644 --- a/src/platform/windows/win_thread.c +++ b/src/platform/windows/win_thread.c @@ -18,6 +18,10 @@ #if defined(__MINGW32__) || defined(__MINGW64__) #define InterlockedAddNoFence64(a, b) \ __atomic_add_fetch(a, b, __ATOMIC_RELAXED) +#define InterlockedIncrementAcquire64(a) \ + __atomic_add_fetch(a, 1, __ATOMIC_ACQUIRE) +#define InterlockedDecrementRelease64(a) \ + __atomic_fetch_sub(a, 1, __ATOMIC_RELEASE) #endif #include <stdlib.h> |
