Skip to content

Commit fe1287e

Browse files
author
Mikael Ronstrom
committed
Fixed 64-bit atomics on Win x86 and removed support for 8 and 16-bit atomic operations
1 parent f06d24c commit fe1287e

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

include/atomic/generic-msvc.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,18 @@
3737
C_MODE_START
3838
/*Visual Studio 2003 and earlier do not have prototypes for atomic intrinsics*/
3939
LONG _InterlockedExchange (LONG volatile *Target,LONG Value);
40-
LONGLONG _InterlockedExchange64 (LONGLONG volatile *Target,LONGLONG Value);
41-
LONG _InterlockedCompareExchange (LONG volatile *Target,
42-
LONG Value, LONG Comp);
43-
LONGLONG _InterlockedCompareExchange64 (LONGLONG volatile *Target,
44-
LONGLONG Value, LONGLONG Comp);
40+
LONG _InterlockedCompareExchange (LONG volatile *Target, LONG Value, LONG Comp);
4541
LONG _InterlockedExchangeAdd (LONG volatile *Addend, LONG Value);
46-
LONGLONG _InterlockedExchangeAdd64 (LONGLONG volatile *Addend, LONGLONG Value);
4742
C_MODE_END
4843

4944
#pragma intrinsic(_InterlockedExchangeAdd)
5045
#pragma intrinsic(_InterlockedCompareExchange)
5146
#pragma intrinsic(_InterlockedExchange)
52-
#pragma intrinsic(_InterlockedExchangeAdd64)
53-
#pragma intrinsic(_InterlockedCompareExchange64)
54-
#pragma intrinsic(_InterlockedExchange64)
5547
#endif
5648

5749
#define InterlockedExchange _InterlockedExchange
5850
#define InterlockedExchangeAdd _InterlockedExchangeAdd
5951
#define InterlockedCompareExchange _InterlockedCompareExchange
60-
#define InterlockedExchange64 _InterlockedExchange64
61-
#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64
62-
#define InterlockedCompareExchange64 _InterlockedCompareExchange64
6352
/*
6453
No need to do something special for InterlockedCompareExchangePointer
6554
as it is a #define to InterlockedCompareExchange. The same applies to

include/my_atomic.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@
5656

5757
#define intptr void *
5858
/**
59-
On most platforms we implement 8-bit, 16-bit, 32-bit and "pointer"
60-
operations. Thus the symbol below is defined by default; platforms
61-
where we leave out 8-bit or 16-bit operations should undefine it.
59+
Currently we don't support 8-bit and 16-bit operations.
60+
It can be added later if needed.
6261
*/
63-
#define MY_ATOMIC_HAS_8_16 1
62+
#undef MY_ATOMIC_HAS_8_16
6463

6564
#ifndef MY_ATOMIC_MODE_RWLOCKS
6665
/*

0 commit comments

Comments
 (0)