Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HZaG7-0003zQ-By for qemu-devel@nongnu.org; Thu, 05 Apr 2007 18:16:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HZaG6-0003zE-Qf for qemu-devel@nongnu.org; Thu, 05 Apr 2007 18:16:47 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HZaG6-0003zB-OO for qemu-devel@nongnu.org; Thu, 05 Apr 2007 18:16:46 -0400 Received: from pf.freedaemonhosting.com ([66.210.104.252] helo=FreeDaemonHosting.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HZaCg-0006MD-Fx for qemu-devel@nongnu.org; Thu, 05 Apr 2007 18:13:14 -0400 Received: from blue.fries.net (blue.isp.fries.net [IPv6:2001:240:58a:100::1c]) by FreeDaemonHosting.com (8.13.8/8.13.3) with ESMTP id l35MCpiG011502 for ; Thu, 5 Apr 2007 17:12:51 -0500 (CDT) Received: from blue.fries.net (localhost.fries.net [IPv6:::1]) by blue.fries.net (8.14.0/8.13.6) with ESMTP id l35MChhA012485 for ; Thu, 5 Apr 2007 17:12:43 -0500 (CDT) Received: (from todd@localhost) by blue.fries.net (8.14.0/8.13.6/Submit) id l35MCgoH014510 for qemu-devel@nongnu.org; Thu, 5 Apr 2007 17:12:42 -0500 (CDT) Date: Thu, 5 Apr 2007 17:12:42 -0500 From: "Todd T. Fries" Subject: Re: [Qemu-devel] Patch: dyngen-exec.h for OpenBSD Message-ID: <20070405221242.GB4559@fries.net> References: <20070321023900.GA13604@fries.net> <20070402095453.GB24846@networkno.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070402095453.GB24846@networkno.de> Reply-To: todd@fries.net, 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 Penned by Thiemo Seufer on 20070402 10:54.53, we have: | > /* NOTE: standard headers should be used with special care at this | > point because host CPU registers are used as global variables. Some | > host headers do not allow that. */ | > #include | > - | > +#ifdef __OpenBSD__ | > +#include | > +#else | > typedef unsigned char uint8_t; | > typedef unsigned short uint16_t; | > typedef unsigned int uint32_t; | > @@ -61,6 +65,7 @@ typedef signed long int64_t; | > typedef signed long long int64_t; | > #endif | > #endif | > +#endif | | Is this specialcase really needed for OpenBSD? Can you honestly tell me that on all platforms this is true? Hello? Portability? sys/types.h defines these types portably. Doing so the way this code does it, is not portable. I left your non portable code to you; if systems in general define these types in sys/types.h then just remove the typedefs, problem solved. | > /* XXX: This may be wrong for 64-bit ILP32 hosts. */ | > typedef void * host_reg_t; | > @@ -78,11 +83,15 @@ typedef void * host_reg_t; | > #define UINT32_MAX (4294967295U) | > #define UINT64_MAX ((uint64_t)(18446744073709551615)) | > | > +#ifdef __OpenBSD__ | > +typedef struct __sFILE FILE; | > +#else | > typedef struct FILE FILE; | > extern int fprintf(FILE *, const char *, ...); | > extern int printf(const char *, ...); | > #undef NULL | > #define NULL 0 | > +#endif | | Shouldn't this cover only the FILE typedef? Why is it that qemu knows what the definition of these prototypes are on all systems without consulting the header files. I have a better idea, lets let the header files define the prototypes. Who would have though of that? .. of course I purposefully intended to remove cruft that is in header files and belongs in header files. I'll look at your other comments later, but these I see later in the discussion are nearing inclusion with your recommended tweaks. I'll submit patches to correct things again if necessary. Thanks, -- Todd Fries .. todd@fries.net _____________________________________________ | \ 1.636.410.0632 (voice) | Free Daemon Consulting, LLC \ 1.405.227.9094 (voice) | http://FreeDaemonConsulting.com \ 1.866.792.3418 (FAX) | "..in support of free software solutions." \ 250797 (FWD) | \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 37E7 D3EB 74D0 8D66 A68D B866 0326 204E 3F42 004A http://todd.fries.net/pgp.txt