Skip to contentSkip to conversation

Compilation fix for OSX/ppc64

PATCH In review Andreas Färber 1 participant 2 messages Jul 26, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Compilation fix for OSX/ppc64

Hello,

The attached patch should fix the compilation error (type conflict for [u]int64_t) reported by René Rebe for Mac OS X ppc64.

Like on OSX/x86-64 we should not define [u]int64_t in dyngen-exec.h for OSX/ppc64 because they are already defined in the system headers (to [unsigned] long long). The comments are updated to match the code.

Not tested on OSX/ppc64, but that's not yet working anyway.

Andreas

dyngen-exec.h +4 -4
index 2b616a9..40f1e3e 100644
@@ -35,8 +35,8 @@
 typedef unsigned char uint8_t;
 typedef unsigned short uint16_t;
 typedef unsigned int uint32_t;
-// Linux/Sparc64 defines uint64_t
-#if !(defined (__sparc_v9__) && defined(__linux__)) && !(defined(__APPLE__) && defined(__x86_64__))
+// Linux/Sparc64, OSX/ppc64 and OSX/x86-64 define uint64_t
+#if !(defined (__sparc_v9__) && defined(__linux__)) && !(defined(__APPLE__) && (defined(__ppc64__) || defined(__x86_64__)))
 /* XXX may be done for all 64 bits targets ? */
 #if defined (__x86_64__) || defined(__ia64) || defined(__s390x__) || defined(__alpha__) || defined(__powerpc64__)
 typedef unsigned long uint64_t;
@@ -53,8 +53,8 @@ typedef signed char int8_t;
 #endif
 typedef signed short int16_t;
 typedef signed int int32_t;
-// Linux/Sparc64 defines int64_t
-#if !(defined (__sparc_v9__) && defined(__linux__)) && !(defined(__APPLE__) && defined(__x86_64__))
+// Linux/Sparc64, OSX/ppc64 and OSX/x86-64 define int64_t
+#if !(defined (__sparc_v9__) && defined(__linux__)) && !(defined(__APPLE__) && (defined(__ppc64__) || defined(__x86_64__)))
 #if defined (__x86_64__) || defined(__ia64) || defined(__s390x__) || defined(__alpha__) || defined(__powerpc64__)
 typedef signed long int64_t;
 #else
#1 lore raw

Am 26.07.2008 um 15:33 schrieb Andreas Färber:

Quoted 1 line

The attached patch should fix the compilation error (type conflict for [u]int64_t) reported by René Rebe for Mac OS X ppc64.

Sorry, not my day today: It's for the error reported by C. W. Betts obviously.

Quoted 8 lines

Like on OSX/x86-64 we should not define [u]int64_t in dyngen-exec.h for OSX/ppc64 because they are already defined in the system headers (to [unsigned] long long). The comments are updated to match the code.

Not tested on OSX/ppc64, but that's not yet working anyway.

Andreas
<qemu-osx-ppc64-int64error.diff>