Commit 13310f28 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot 8

Eliminate the atomic porability header's dependence on Windows.h

Summary:
This is done by using the intrinsic directly instead.
This also marks the input parameter as `volatile`, to make it more clear that that's how it is handled by `_InterlockedExchangeAdd64`.

Reviewed By: yfeldblum

Differential Revision: D3671320

fbshipit-source-id: 6010085ec3b6952a3eb1e952965ec6ad87566db2
parent db33d307
......@@ -18,14 +18,14 @@
#ifdef _WIN32
#include <intrin.h>
#include <stdint.h>
#include <folly/Portability.h>
// The intrinsics we need are in Windows.h :(
#include <folly/portability/Windows.h>
FOLLY_ALWAYS_INLINE int64_t __sync_fetch_and_add(int64_t* ptr, int64_t value) {
return InterlockedExchangeAdd64(ptr, value);
FOLLY_ALWAYS_INLINE
int64_t __sync_fetch_and_add(volatile int64_t* ptr, int64_t value) {
return _InterlockedExchangeAdd64(ptr, value);
}
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment