qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] w64: Don't redefine lseek, ftruncate


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH] w64: Don't redefine lseek, ftruncate
Date: Sat, 10 Mar 2012 13:11:00 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120215 Thunderbird/10.0.2

Am 10.03.2012 11:14, schrieb Stefan Weil:
> 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 <address@hidden>
> ---
>  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

lseek looks okay to me, but did you check that ftruncate and
qemu_ftruncate64 behave the same?

Andreas

>  
>  static inline char *realpath(const char *path, char *resolved_path)
>  {

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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