qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [6736] Sparse fixes: NULL use, header order, ANSI prot


From: Blue Swirl
Subject: Re: [Qemu-devel] [6736] Sparse fixes: NULL use, header order, ANSI prototypes, static
Date: Sun, 8 Mar 2009 18:23:20 +0200

On 3/8/09, Anthony Liguori <address@hidden> wrote:
> Blue Swirl wrote:
>
> > Taking vl.c as an example, do you mean that even these headers:
> > #include <unistd.h>
> > #include <fcntl.h>
> > #include <signal.h>
> > #include <time.h>
> > #include <errno.h>
> > #include <sys/time.h>
> > #include <zlib.h>
> > before config-host.h line are now broken because of missing windows.h
> > include? Or is it just some header below that?
> >
> >
>
>  Just windows headers.  For example, from net.c:
>
>
> > #include <unistd.h>
> > #include <fcntl.h>
> > #include <signal.h>
> > #include <time.h>
> > #include <errno.h>
> > #include <sys/time.h>
> > #include <zlib.h>
> >
> > /* Needed early for HOST_BSD etc. */
> > #include "config-host.h"
> >
> > #ifndef _WIN32
> > #include <sys/times.h>
> > #include <sys/wait.h>
> > #include <termios.h>
> > #include <sys/mman.h>
> > #include <sys/ioctl.h>
> > #include <sys/resource.h>
> > #include <sys/socket.h>
> > #include <netinet/in.h>
> > #include <net/if.h>
> > #ifdef __NetBSD__
> > #include <net/if_tap.h>
> > #endif
> > #ifdef __linux__
> > #include <linux/if_tun.h>
> > #endif
> > #include <arpa/inet.h>
> > #include <dirent.h>
> > #include <netdb.h>
> > #include <sys/select.h>
> > #ifdef HOST_BSD
> > #include <sys/stat.h>
> > #if defined(__FreeBSD__) || defined(__DragonFly__)
> > #include <libutil.h>
> > #else
> > #include <util.h>
> > #endif
> > #elif defined (__GLIBC__) && defined (__FreeBSD_kernel__)
> > #include <freebsd/stdlib.h>
> > #else
> > #ifdef __linux__
> > #include <pty.h>
> > #include <malloc.h>
> > #include <linux/rtc.h>
> >
> > /* For the benefit of older linux systems which don't supply it,
> >   we use a local copy of hpet.h. */
> > /* #include <linux/hpet.h> */
> > #include "hpet.h"
> >
> > #include <linux/ppdev.h>
> > #include <linux/parport.h>
> > #endif
> > #ifdef __sun__
> > #include <sys/stat.h>
> > #include <sys/ethernet.h>
> > #include <sys/sockio.h>
> > #include <netinet/arp.h>
> > #include <netinet/in.h>
> > #include <netinet/in_systm.h>
> > #include <netinet/ip.h>
> > #include <netinet/ip_icmp.h> // must come after ip.h
> > #include <netinet/udp.h>
> > #include <netinet/tcp.h>
> > #include <net/if.h>
> > #include <syslog.h>
> > #include <stropts.h>
> > #endif
> > #endif
> > #endif
> >
> > #if defined(__OpenBSD__)
> > #include <util.h>
> > #endif
> >
> > #if defined(CONFIG_VDE)
> > #include <libvdeplug.h>
> > #endif
> >
> > #ifdef _WIN32
> > #include <malloc.h>
> > #include <sys/timeb.h>
> > #include <mmsystem.h>
> > #define getopt_long_only getopt_long
> > #define memalign(align, size) malloc(size)
> > #endif
> >
>
>  mmsystem.h needs windows.h to be included first.  We need to get that
> include from qemu-common.h.  I see three options:
>
>  1) include qemu-common.h at the top of every file as we were previously
>  2) split out a qemu-win32.h or something like that that just contained the
> windows headers included as we need them
>  3) explicitly include <windows.h> and use -D CFLAGS to set things up as we
> need it.
>
>  I guess #3 looks the best to me.

I'd go for 2) but make it qemu-host.h which hides all Win/Linux/BSD
specific stuff, maybe with -D tuning.




reply via email to

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