bpo-30389 Adds detection of VS 2017 to distutils._msvccompiler (#1632)

This commit is contained in:
Steve Dower 2017-09-07 11:49:23 -07:00 committed by GitHub
parent a853a8ba78
commit 05f01d8525
16 changed files with 1272 additions and 110 deletions

View file

@ -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;
}
}