qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] Compilation errors on BSD


From: andrzej zaborowski
Subject: [Qemu-devel] [PATCH] Compilation errors on BSD
Date: Sat, 7 Jan 2006 04:14:39 +0100

Hiyas,
Today I tried compiling QEMU on a FreeBSD computer and it spitted at
me a bunch of errors, all of them being results of trivial differences
in system headers. The following patch fixed them and I got a working
QEMU 0.8.0, in case anyone's interested. There was also another
trivial change needed to get KQEMU working (but this I will keep for
myself, to be alright with the license). As far as I have checked,
compiling on OpenBSD would require these same changes.
Greetings,
Andrew

diff -Naur qemu-0.8.0/dyngen-exec.h qemu-0.8.0-fbsd/dyngen-exec.h
--- qemu-0.8.0/dyngen-exec.h    Mon Dec 19 22:51:53 2005
+++ qemu-0.8.0-fbsd/dyngen-exec.h       Sat Jan  7 01:41:47 2006
@@ -25,23 +25,47 @@
    host headers do not allow that. */
 #include <stddef.h>

+#if !defined(_UINT8_T_DECLARED)
 typedef unsigned char uint8_t;
+#define _UINT8_T_DECLARED
+#endif
+#if !defined(_UINT16_T_DECLARED)
 typedef unsigned short uint16_t;
+#define _UINT16_T_DECLARED
+#endif
+#if !defined(_UINT32_T_DECLARED)
 typedef unsigned int uint32_t;
+#define _UINT32_T_DECLARED
+#endif
+#if !defined(_UINT64_T_DECLARED)
 /* XXX may be done for all 64 bits targets ? */
 #if defined (__x86_64__) || defined(__ia64)
 typedef unsigned long uint64_t;
 #else
 typedef unsigned long long uint64_t;
 #endif
+#define _UINT64_T_DECLARED
+#endif

+#if !defined(_INT8_T_DECLARED)
 typedef signed char int8_t;
+#define _INT8_T_DECLARED
+#endif
+#if !defined(_INT16_T_DECLARED)
 typedef signed short int16_t;
+#define _INT16_T_DECLARED
+#endif
+#if !defined(_INT32_T_DECLARED)
 typedef signed int int32_t;
+#define _INT32_T_DECLARED
+#endif
+#if !defined(_INT6_T_DECLARED)
 #if defined (__x86_64__) || defined(__ia64)
 typedef signed long int64_t;
 #else
 typedef signed long long int64_t;
+#endif
+#define _INT64_T_DECLARED
 #endif

 #define INT8_MIN               (-128)
diff -Naur qemu-0.8.0/fpu/softfloat-native.c
qemu-0.8.0-fbsd/fpu/softfloat-nativ e.c
--- qemu-0.8.0/fpu/softfloat-native.c   Mon Dec 19 22:51:53 2005
+++ qemu-0.8.0-fbsd/fpu/softfloat-native.c      Sat Jan  7 01:56:24 2006
@@ -85,7 +85,11 @@
 *----------------------------------------------------------------------------*/
 int float32_to_int32( float32 a STATUS_PARAM)
 {
+#ifdef _BSD
+    return (int)rintf(a);
+#else
     return lrintf(a);
+#endif
 }
 int float32_to_int32_round_to_zero( float32 a STATUS_PARAM)
 {
@@ -93,7 +97,11 @@
 }
 int64_t float32_to_int64( float32 a STATUS_PARAM)
 {
+#ifdef _BSD
+    return (int64_t)rintf(a);
+#else
     return llrintf(a);
+#endif
 }

 int64_t float32_to_int64_round_to_zero( float32 a STATUS_PARAM)
diff -Naur qemu-0.8.0/fpu/softfloat-native.h
qemu-0.8.0-fbsd/fpu/softfloat-nativ e.h
--- qemu-0.8.0/fpu/softfloat-native.h   Mon Dec 19 22:51:53 2005
+++ qemu-0.8.0-fbsd/fpu/softfloat-native.h      Sat Jan  7 01:35:40 2006
@@ -36,9 +36,9 @@
 #if defined(_BSD) && !defined(__APPLE__)
 enum {
     float_round_nearest_even = FP_RN,
-    float_round_down         = FE_RM,
-    float_round_up           = FE_RP,
-    float_round_to_zero      = FE_RZ
+    float_round_down         = FP_RM,
+    float_round_up           = FP_RP,
+    float_round_to_zero      = FP_RZ
 };
 #elif defined(__arm__)
 enum {
diff -Naur qemu-0.8.0/osdep.c qemu-0.8.0-fbsd/osdep.c
--- qemu-0.8.0/osdep.c  Mon Dec 19 22:51:53 2005
+++ qemu-0.8.0-fbsd/osdep.c     Sat Jan  7 01:28:22 2006
@@ -323,7 +323,13 @@

 #elif defined(USE_KQEMU)

+#if defined(_BSD)
+#include <sys/param.h>
+#include <sys/mount.h>
+#else
 #include <sys/vfs.h>
+#endif
+
 #include <sys/mman.h>
 #include <fcntl.h>

--
balrog 2oo6

Dear Outlook users: Please remove me from your address books
http://www.newsforge.com/article.pl?sid=03/08/21/143258




reply via email to

[Prev in Thread] Current Thread [Next in Thread]