From 794ba23189a38c2b6a92d95a7a90c9e602cd2a7b Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Tue, 4 Feb 2020 13:31:41 +0000 Subject: [PATCH] Unbreak Clang build on PowerPC In file included from source/gfxlib/2xSaI.c:10: source/gamelib/borendian.h:63:60: error: unsupported inline asm: input with type 'int' matching output with type 'UInt16' (aka 'unsigned short') __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x)); ~~~~~~ ^~~~~~ --- engine/source/gamelib/borendian.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/source/gamelib/borendian.h b/engine/source/gamelib/borendian.h index 71f47dfba..e60d33ee4 100644 --- a/engine/source/gamelib/borendian.h +++ b/engine/source/gamelib/borendian.h @@ -58,10 +58,10 @@ static __inline__ UInt16 Swap16(UInt16 x) #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) static __inline__ UInt16 Swap16(UInt16 x) { - UInt16 result; + UInt32 result; __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x)); - return result; + return (UInt16)result; } #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) static __inline__ UInt16 Swap16(UInt16 x)