From: Hans Wennborg Date: Thu, 23 Jan 2014 19:15:39 +0000 (+0000) Subject: Intrin.h: fix definitions of _Interlocked{In,De}crement16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b76b51e80bf36a367600eb1d088f7c24625bf195;p=clang Intrin.h: fix definitions of _Interlocked{In,De}crement16 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 --- diff --git a/lib/Headers/Intrin.h b/lib/Headers/Intrin.h index b0fe2ce439..82aadb2e33 100644 --- a/lib/Headers/Intrin.h +++ b/lib/Headers/Intrin.h @@ -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__))