From 835a2b9902346600cdc2d6b1f2dd2282e804bf4a Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Wed, 18 Jan 2012 15:38:16 +0100 Subject: Make clang compile the new i386 and x86_64 atomic code The input type needs to match the output type, otherwise we get this error: src/corelib/arch/qatomic_x86_64.h:288:25: error: unsupported inline asm: input with type '' matching output with type 'T': "0" (valueToAdd * QAtomicAdditiveType::AddScale) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I26d4efdbcab089dea71ef08e3e65df5b7482865a Reviewed-by: Olivier Goffart Reviewed-by: Thiago Macieira --- src/corelib/arch/qatomic_x86_64.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/arch/qatomic_x86_64.h') diff --git a/src/corelib/arch/qatomic_x86_64.h b/src/corelib/arch/qatomic_x86_64.h index 342cd12294..db334700b2 100644 --- a/src/corelib/arch/qatomic_x86_64.h +++ b/src/corelib/arch/qatomic_x86_64.h @@ -284,7 +284,7 @@ T QBasicAtomicOps::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiv asm volatile("lock\n" "xadd %0,%1" : "=r" (result), "+m" (_q_value) - : "0" (valueToAdd * QAtomicAdditiveType::AddScale) + : "0" (T(valueToAdd * QAtomicAdditiveType::AddScale)) : "memory"); return result; } @@ -296,7 +296,7 @@ T QBasicAtomicOps<1>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveTy asm volatile("lock\n" "xadd %0,%1" : "=q" (result), "+m" (_q_value) - : "0" (valueToAdd * QAtomicAdditiveType::AddScale) + : "0" (T(valueToAdd * QAtomicAdditiveType::AddScale)) : "memory"); return result; } -- cgit v1.2.3