From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6Oz2-00050g-WC for qemu-devel@nongnu.org; Sat, 10 Mar 2012 11:17:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S6Oz0-0003k5-Df for qemu-devel@nongnu.org; Sat, 10 Mar 2012 11:17:28 -0500 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:40045) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6Oz0-0003jo-7F for qemu-devel@nongnu.org; Sat, 10 Mar 2012 11:17:26 -0500 Message-ID: <4F5B7E92.5010402@weilnetz.de> Date: Sat, 10 Mar 2012 17:17:22 +0100 From: Stefan Weil MIME-Version: 1.0 References: <1331374472-15157-1-git-send-email-sw@weilnetz.de> <4F5B44D4.5030105@suse.de> In-Reply-To: <4F5B44D4.5030105@suse.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] w64: Don't redefine lseek, ftruncate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?Andreas_F=E4rber?= Cc: qemu-devel@nongnu.org Am 10.03.2012 13:11, schrieb Andreas F=E4rber: > Am 10.03.2012 11:14, schrieb Stefan Weil: > =20 >> MinGW-w64 already defines lseek and ftruncate (and uses the 64 bit >> variants). The conditional compilation avoids redefinitions >> (which would be wrong) and compiler warnings. >> >> Signed-off-by: Stefan Weil >> --- >> qemu-common.h | 8 ++++++-- >> 1 files changed, 6 insertions(+), 2 deletions(-) >> >> diff --git a/qemu-common.h b/qemu-common.h >> index dbfce6f..b0fdf5c 100644 >> --- a/qemu-common.h >> +++ b/qemu-common.h >> @@ -93,9 +93,13 @@ typedef int (*fprintf_function)(FILE *f, const char= *fmt, ...) >> >> #ifdef _WIN32 >> #define fsync _commit >> -#define lseek _lseeki64 >> +#if !defined(lseek) >> +# define lseek _lseeki64 >> +#endif >> int qemu_ftruncate64(int, int64_t); >> -#define ftruncate qemu_ftruncate64 >> +#if !defined(ftruncate) >> +# define ftruncate qemu_ftruncate64 >> +#endif >> =20 > lseek looks okay to me, but did you check that ftruncate and > qemu_ftruncate64 behave the same? > > Andreas > =20 qemu_ftruncate64 was added in 1996. It is only used for MinGW32, and maybe not even needed there, because it is simply a 64 bit implementation of ftruncate. Eliminating qemu_ftruncate64 might be handled in a separate patch. The MinGW32 and MinGW-w64 functions ftruncate64 should be sufficient, and MinGW-w64 uses #define ftruncate ftruncate64. Regards, Stefan