Commit 24646c7ed8a94a2b39e03121f0079bb89e708ec7
1 parent
57a92c8e
Fix some build issues for BSD.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5646 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
36 additions
and
20 deletions
net.c
| @@ -54,26 +54,31 @@ | @@ -54,26 +54,31 @@ | ||
| 54 | #include <termios.h> | 54 | #include <termios.h> |
| 55 | #include <sys/mman.h> | 55 | #include <sys/mman.h> |
| 56 | #include <sys/ioctl.h> | 56 | #include <sys/ioctl.h> |
| 57 | +#include <sys/resource.h> | ||
| 57 | #include <sys/socket.h> | 58 | #include <sys/socket.h> |
| 58 | #include <netinet/in.h> | 59 | #include <netinet/in.h> |
| 60 | +#include <net/if.h> | ||
| 61 | +#ifdef __NetBSD__ | ||
| 62 | +#include <net/if_tap.h> | ||
| 63 | +#endif | ||
| 64 | +#ifdef __linux__ | ||
| 65 | +#include <linux/if_tun.h> | ||
| 66 | +#endif | ||
| 67 | +#include <arpa/inet.h> | ||
| 59 | #include <dirent.h> | 68 | #include <dirent.h> |
| 60 | #include <netdb.h> | 69 | #include <netdb.h> |
| 61 | #include <sys/select.h> | 70 | #include <sys/select.h> |
| 62 | -#include <arpa/inet.h> | ||
| 63 | #ifdef _BSD | 71 | #ifdef _BSD |
| 64 | #include <sys/stat.h> | 72 | #include <sys/stat.h> |
| 65 | -#if !defined(__APPLE__) && !defined(__OpenBSD__) | 73 | +#ifdef __FreeBSD__ |
| 66 | #include <libutil.h> | 74 | #include <libutil.h> |
| 67 | -#endif | ||
| 68 | -#ifdef __OpenBSD__ | ||
| 69 | -#include <net/if.h> | 75 | +#else |
| 76 | +#include <util.h> | ||
| 70 | #endif | 77 | #endif |
| 71 | #elif defined (__GLIBC__) && defined (__FreeBSD_kernel__) | 78 | #elif defined (__GLIBC__) && defined (__FreeBSD_kernel__) |
| 72 | #include <freebsd/stdlib.h> | 79 | #include <freebsd/stdlib.h> |
| 73 | #else | 80 | #else |
| 74 | #ifdef __linux__ | 81 | #ifdef __linux__ |
| 75 | -#include <linux/if.h> | ||
| 76 | -#include <linux/if_tun.h> | ||
| 77 | #include <pty.h> | 82 | #include <pty.h> |
| 78 | #include <malloc.h> | 83 | #include <malloc.h> |
| 79 | #include <linux/rtc.h> | 84 | #include <linux/rtc.h> |
qemu-char.c
| @@ -45,25 +45,31 @@ | @@ -45,25 +45,31 @@ | ||
| 45 | #include <termios.h> | 45 | #include <termios.h> |
| 46 | #include <sys/mman.h> | 46 | #include <sys/mman.h> |
| 47 | #include <sys/ioctl.h> | 47 | #include <sys/ioctl.h> |
| 48 | +#include <sys/resource.h> | ||
| 48 | #include <sys/socket.h> | 49 | #include <sys/socket.h> |
| 49 | #include <netinet/in.h> | 50 | #include <netinet/in.h> |
| 51 | +#include <net/if.h> | ||
| 52 | +#ifdef __NetBSD__ | ||
| 53 | +#include <net/if_tap.h> | ||
| 54 | +#endif | ||
| 55 | +#ifdef __linux__ | ||
| 56 | +#include <linux/if_tun.h> | ||
| 57 | +#endif | ||
| 58 | +#include <arpa/inet.h> | ||
| 50 | #include <dirent.h> | 59 | #include <dirent.h> |
| 51 | #include <netdb.h> | 60 | #include <netdb.h> |
| 52 | #include <sys/select.h> | 61 | #include <sys/select.h> |
| 53 | -#include <arpa/inet.h> | ||
| 54 | #ifdef _BSD | 62 | #ifdef _BSD |
| 55 | #include <sys/stat.h> | 63 | #include <sys/stat.h> |
| 56 | -#if !defined(__APPLE__) && !defined(__OpenBSD__) | 64 | +#ifdef __FreeBSD__ |
| 57 | #include <libutil.h> | 65 | #include <libutil.h> |
| 58 | -#endif | ||
| 59 | -#ifdef __OpenBSD__ | ||
| 60 | -#include <net/if.h> | 66 | +#else |
| 67 | +#include <util.h> | ||
| 61 | #endif | 68 | #endif |
| 62 | #elif defined (__GLIBC__) && defined (__FreeBSD_kernel__) | 69 | #elif defined (__GLIBC__) && defined (__FreeBSD_kernel__) |
| 63 | #include <freebsd/stdlib.h> | 70 | #include <freebsd/stdlib.h> |
| 64 | #else | 71 | #else |
| 65 | #ifdef __linux__ | 72 | #ifdef __linux__ |
| 66 | -#include <linux/if.h> | ||
| 67 | #include <pty.h> | 73 | #include <pty.h> |
| 68 | 74 | ||
| 69 | #include <linux/ppdev.h> | 75 | #include <linux/ppdev.h> |
vl.c
| @@ -55,26 +55,31 @@ | @@ -55,26 +55,31 @@ | ||
| 55 | #include <termios.h> | 55 | #include <termios.h> |
| 56 | #include <sys/mman.h> | 56 | #include <sys/mman.h> |
| 57 | #include <sys/ioctl.h> | 57 | #include <sys/ioctl.h> |
| 58 | +#include <sys/resource.h> | ||
| 58 | #include <sys/socket.h> | 59 | #include <sys/socket.h> |
| 59 | #include <netinet/in.h> | 60 | #include <netinet/in.h> |
| 61 | +#include <net/if.h> | ||
| 62 | +#if defined(__NetBSD__) | ||
| 63 | +#include <net/if_tap.h> | ||
| 64 | +#endif | ||
| 65 | +#ifdef __linux__ | ||
| 66 | +#include <linux/if_tun.h> | ||
| 67 | +#endif | ||
| 68 | +#include <arpa/inet.h> | ||
| 60 | #include <dirent.h> | 69 | #include <dirent.h> |
| 61 | #include <netdb.h> | 70 | #include <netdb.h> |
| 62 | #include <sys/select.h> | 71 | #include <sys/select.h> |
| 63 | -#include <arpa/inet.h> | ||
| 64 | #ifdef _BSD | 72 | #ifdef _BSD |
| 65 | #include <sys/stat.h> | 73 | #include <sys/stat.h> |
| 66 | -#if !defined(__APPLE__) && !defined(__OpenBSD__) | 74 | +#ifdef __FreeBSD__ |
| 67 | #include <libutil.h> | 75 | #include <libutil.h> |
| 68 | -#endif | ||
| 69 | -#ifdef __OpenBSD__ | ||
| 70 | -#include <net/if.h> | 76 | +#else |
| 77 | +#include <util.h> | ||
| 71 | #endif | 78 | #endif |
| 72 | #elif defined (__GLIBC__) && defined (__FreeBSD_kernel__) | 79 | #elif defined (__GLIBC__) && defined (__FreeBSD_kernel__) |
| 73 | #include <freebsd/stdlib.h> | 80 | #include <freebsd/stdlib.h> |
| 74 | #else | 81 | #else |
| 75 | #ifdef __linux__ | 82 | #ifdef __linux__ |
| 76 | -#include <linux/if.h> | ||
| 77 | -#include <linux/if_tun.h> | ||
| 78 | #include <pty.h> | 83 | #include <pty.h> |
| 79 | #include <malloc.h> | 84 | #include <malloc.h> |
| 80 | #include <linux/rtc.h> | 85 | #include <linux/rtc.h> |