This patch is from MacPorts [1]. I don't know the origin, but as it's quite trivial I hope it's okay to post it without that information.
At least it fixes building QEMU on Mac OS 10.7. The compiler error without that patch: -------------------------- 8< ----------------------------------- /Users/bwalle/devel/qemu/fpu/softfloat.h:60: error: conflicting types for 'uint16' /System/Library/Frameworks/Security.framework/Headers/cssmconfig.h:73: error: previous declaration of 'uint16' was here -------------------------- >8 ----------------------------------- Signed-off-by: Bernhard Walle <bernh...@bwalle.de> [1] https://trac.macports.org/browser/trunk/dports/emulators/qemu/files/patch-cocoa-uint16-redefined.diff --- fpu/softfloat.h | 2 ++ ui/cocoa.m | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fpu/softfloat.h b/fpu/softfloat.h index 2ce4110..7cabe0f 100644 --- a/fpu/softfloat.h +++ b/fpu/softfloat.h @@ -57,7 +57,9 @@ typedef uint8_t flag; typedef uint8_t uint8; typedef int8_t int8; #ifndef _AIX +#if !(defined(__APPLE__) && defined(_UINT16)) typedef int uint16; +#endif typedef int int16; #endif typedef unsigned int uint32; diff --git a/ui/cocoa.m b/ui/cocoa.m index e7d6e89..7feeeff 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -22,13 +22,14 @@ * THE SOFTWARE. */ -#import <Cocoa/Cocoa.h> -#include <crt_externs.h> - #include "qemu-common.h" #include "console.h" #include "sysemu.h" +#define _UINT16 +#import <Cocoa/Cocoa.h> +#include <crt_externs.h> + #ifndef MAC_OS_X_VERSION_10_4 #define MAC_OS_X_VERSION_10_4 1040 #endif -- 1.7.10