]> granicus.if.org Git - clang/commitdiff
Intrin.h: fix definitions of _Interlocked{In,De}crement16
authorHans Wennborg <hans@hanshq.net>
Thu, 23 Jan 2014 19:15:39 +0000 (19:15 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 23 Jan 2014 19:15:39 +0000 (19:15 +0000)
The declarations seem correct, but the definitions were using
chars instead of shorts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199923 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/Intrin.h

index b0fe2ce439505461818fd62f594180588d0295f6..82aadb2e33c3916bf974607edd373c0c38ccbf79 100644 (file)
@@ -600,8 +600,8 @@ _InterlockedExchangeSub64(__int64 volatile *_Subend, __int64 _Value) {
 /*----------------------------------------------------------------------------*\
 |* Interlocked Increment
 \*----------------------------------------------------------------------------*/
-static __inline__ char __attribute__((__always_inline__, __nodebug__))
-_InterlockedIncrement16(char volatile *_Value) {
+static __inline__ short __attribute__((__always_inline__, __nodebug__))
+_InterlockedIncrement16(short volatile *_Value) {
   return __atomic_add_fetch(_Value, 1, 0);
 }
 static __inline__ long __attribute__((__always_inline__, __nodebug__))
@@ -617,8 +617,8 @@ _InterlockedIncrement64(__int64 volatile *_Value) {
 /*----------------------------------------------------------------------------*\
 |* Interlocked Decrement
 \*----------------------------------------------------------------------------*/
-static __inline__ char __attribute__((__always_inline__, __nodebug__))
-_InterlockedDecrement16(char volatile *_Value) {
+static __inline__ short __attribute__((__always_inline__, __nodebug__))
+_InterlockedDecrement16(short volatile *_Value) {
   return __atomic_sub_fetch(_Value, 1, 0);
 }
 static __inline__ long __attribute__((__always_inline__, __nodebug__))