diff options
author | Steve Dower <steve.dower@microsoft.com> | 2017-09-07 18:49:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-07 18:49:23 (GMT) |
commit | 05f01d85257d0f3409c7335aaf0bf6a6da7eecb7 (patch) | |
tree | 32f5e8671e6f384e1ee8b3d38c45495778f45f03 /Include/pyatomic.h | |
parent | a853a8ba7850381d49b284295dd6f0dc491dbe44 (diff) | |
download | cpython-05f01d85257d0f3409c7335aaf0bf6a6da7eecb7.zip cpython-05f01d85257d0f3409c7335aaf0bf6a6da7eecb7.tar.gz cpython-05f01d85257d0f3409c7335aaf0bf6a6da7eecb7.tar.bz2 |
bpo-30389 Adds detection of VS 2017 to distutils._msvccompiler (#1632)
Diffstat (limited to 'Include/pyatomic.h')
-rw-r--r-- | Include/pyatomic.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Include/pyatomic.h b/Include/pyatomic.h index 4cbc529..bd516b8 100644 --- a/Include/pyatomic.h +++ b/Include/pyatomic.h @@ -285,20 +285,20 @@ typedef struct _Py_atomic_int { a uintptr_t it will do an unsigned compare and crash */ inline intptr_t _Py_atomic_load_64bit(volatile uintptr_t* value, int order) { - uintptr_t old; + __int64 old; switch (order) { case _Py_memory_order_acquire: { do { old = *value; - } while(_InterlockedCompareExchange64_HLEAcquire(value, old, old) != old); + } while(_InterlockedCompareExchange64_HLEAcquire((volatile __int64*)value, old, old) != old); break; } case _Py_memory_order_release: { do { old = *value; - } while(_InterlockedCompareExchange64_HLERelease(value, old, old) != old); + } while(_InterlockedCompareExchange64_HLERelease((volatile __int64*)value, old, old) != old); break; } case _Py_memory_order_relaxed: @@ -308,7 +308,7 @@ inline intptr_t _Py_atomic_load_64bit(volatile uintptr_t* value, int order) { { do { old = *value; - } while(_InterlockedCompareExchange64(value, old, old) != old); + } while(_InterlockedCompareExchange64((volatile __int64*)value, old, old) != old); break; } } @@ -320,20 +320,20 @@ inline intptr_t _Py_atomic_load_64bit(volatile uintptr_t* value, int order) { #endif inline int _Py_atomic_load_32bit(volatile int* value, int order) { - int old; + long old; switch (order) { case _Py_memory_order_acquire: { do { old = *value; - } while(_InterlockedCompareExchange_HLEAcquire(value, old, old) != old); + } while(_InterlockedCompareExchange_HLEAcquire((volatile long*)value, old, old) != old); break; } case _Py_memory_order_release: { do { old = *value; - } while(_InterlockedCompareExchange_HLERelease(value, old, old) != old); + } while(_InterlockedCompareExchange_HLERelease((volatile long*)value, old, old) != old); break; } case _Py_memory_order_relaxed: @@ -343,7 +343,7 @@ inline int _Py_atomic_load_32bit(volatile int* value, int order) { { do { old = *value; - } while(_InterlockedCompareExchange(value, old, old) != old); + } while(_InterlockedCompareExchange((volatile long*)value, old, old) != old); break; } } |