From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ev4ZH-000501-PH for qemu-devel@nongnu.org; Fri, 06 Jan 2006 22:16:35 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ev4ZF-0004zE-Aj for qemu-devel@nongnu.org; Fri, 06 Jan 2006 22:16:34 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ev4ZF-0004z4-4L for qemu-devel@nongnu.org; Fri, 06 Jan 2006 22:16:33 -0500 Received: from [66.249.82.194] (helo=xproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Ev4b6-0000zZ-4Z for qemu-devel@nongnu.org; Fri, 06 Jan 2006 22:18:28 -0500 Received: by xproxy.gmail.com with SMTP id s6so2287276wxc for ; Fri, 06 Jan 2006 19:14:39 -0800 (PST) Message-ID: Date: Sat, 7 Jan 2006 04:14:39 +0100 From: andrzej zaborowski MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: [Qemu-devel] [PATCH] Compilation errors on BSD Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 +#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 =3D FP_RN, - float_round_down =3D FE_RM, - float_round_up =3D FE_RP, - float_round_to_zero =3D FE_RZ + float_round_down =3D FP_RM, + float_round_up =3D FP_RP, + float_round_to_zero =3D 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 +#include +#else #include +#endif + #include #include -- balrog 2oo6 Dear Outlook users: Please remove me from your address books http://www.newsforge.com/article.pl?sid=3D03/08/21/143258