build fix: Make slirp build on NetBSD
PATCH 1/1 build fix: Make slirp build on NetBSD
Hi!
slirp fails to build on NetBSD with these errors:
In file included from /data/qemu/qemu-git/slirp/tcp_var.h:37,
from /data/qemu/qemu-git/slirp/tcp.h:72,
from /data/qemu/qemu-git/slirp/slirp.h:192,
from slirp/cksum.c:33:/data/qemu/qemu-git/slirp/tcp_timer.h:123: error:
expected '=', ',', ';', 'asm' or '_
_attribute__' before numeric constant /data/qemu/qemu-git/slirp/tcp_timer.h:124: error:
expected '=', ',', ';', 'asm' or '_
_attribute__' before numeric constant /data/qemu/qemu-git/slirp/tcp_timer.h:125: error:
expected '=', ',', ';', 'asm' or '_
_attribute__' before numeric constant
In file included from /data/qemu/qemu-git/slirp/slirp.h:196,
from slirp/cksum.c:33:
/data/qemu/qemu-git/slirp/udp.h:76: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant /data/qemu/qemu-git/slirp/udp.h:77: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant /data/qemu/qemu-git/slirp/udp.h:78: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant /data/qemu/qemu-git/slirp/udp.h:79: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant /data/qemu/qemu-git/slirp/udp.h:80: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant /data/qemu/qemu-git/slirp/udp.h:81: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant
In file included from /data/qemu/qemu-git/slirp/slirp.h:197,
from slirp/cksum.c:33:
/data/qemu/qemu-git/slirp/mbuf.h:118: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant /data/qemu/qemu-git/slirp/mbuf.h:119: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant /data/qemu/qemu-git/slirp/mbuf.h:120: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant /data/qemu/qemu-git/slirp/mbuf.h:121: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant /data/qemu/qemu-git/slirp/mbuf.h:122: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant /data/qemu/qemu-git/slirp/mbuf.h:123: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant /data/qemu/qemu-git/slirp/mbuf.h:124: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant /data/qemu/qemu-git/slirp/mbuf.h:125: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant
Attached patch makes slirp build.
Signature · 6 lines
---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632
slirp/ip_icmp.h +2 -2
@@ -153,9 +153,9 @@ struct icmp { (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \ (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY) -void icmp_input _P((struct mbuf *, int)); +void icmp_input (struct mbuf *,int );void icmp_error (struct mbuf *msrc,u_char type,u_char code,int minsize,const char *message); -void icmp_reflect _P((struct mbuf *)); +void icmp_reflect (struct mbuf *);#endif
slirp/mbuf.h +8 -8
@@ -115,13 +115,13 @@ struct mbuf {#define M_DOFREE 0x08/* when m_free is called on the mbuf, free() * it rather than putting it on the free list */ -void m_init _P((Slirp *)); -struct mbuf * m_get _P((Slirp *)); -void m_free _P((struct mbuf *)); -void m_cat _P((register struct mbuf *, register struct mbuf *)); -void m_inc _P((struct mbuf *, int)); -void m_adj _P((struct mbuf *, int)); -int m_copy _P((struct mbuf *, struct mbuf *, int, int)); -struct mbuf * dtom _P((Slirp *, void *)); +void m_init (Slirp *); +struct mbuf *m_get (Slirp *); +void m_free (struct mbuf *); +void m_cat (registerstruct mbuf *, registerstruct mbuf *); +void m_inc (struct mbuf *,int ); +void m_adj (struct mbuf *,int ); +int m_copy (struct mbuf *,struct mbuf *,int ,int ); +struct mbuf *dtom (Slirp *,void *);#endif
slirp/misc.h +15 -15
@@ -20,7 +20,7 @@ struct ex_list { char *strdup _P((const char *));#endif -void do_wait _P((int)); +void do_wait (int );#define EMU_NONE 0x0
@@ -58,20 +58,20 @@ struct emu_t {extern int x_port, x_server, x_display; -int show_x _P((char *, struct socket *)); -void redir_x _P((u_int32_t, int, int, int)); -void slirp_insque _P((void *, void *)); -void slirp_remque _P((void *)); -int add_exec _P((struct ex_list **, int, char *, struct in_addr, int)); -int slirp_openpty _P((int *, int *)); +int show_x (char *,struct socket *); +void redir_x (u_int32_t ,int ,int ,int ); +void slirp_insque (void *,void *); +void slirp_remque (void *); +int add_exec (struct ex_list **,int ,char *,struct in_addr ,int ); +int slirp_openpty (int *,int *);int fork_exec (struct socket *so,const char *ex,int do_pty); -void snooze_hup _P((int)); -void snooze _P((void)); -void relay _P((int)); -void add_emu _P((char *)); -void u_sleep _P((int)); -void fd_nonblock _P((int)); -void fd_block _P((int)); -int rsh_exec _P((struct socket *, struct socket *, char *, char *, char *)); +void snooze_hup (int ); +void snooze (void ); +void relay (int ); +void add_emu (char *); +void u_sleep (int ); +void fd_nonblock (int ); +void fd_block (int ); +int rsh_exec (struct socket *,struct socket *,char *,char *,char *);#endif
slirp/sbuf.h +5 -5
@@ -21,10 +21,10 @@ struct sbuf { char *sb_data; /* Actual data */ }; -void sbfree _P((struct sbuf *)); -void sbdrop _P((struct sbuf *, int)); -void sbreserve _P((struct sbuf *, int)); -void sbappend _P((struct socket *, struct mbuf *)); -void sbcopy _P((struct sbuf *, int, int, char *)); +void sbfree (struct sbuf *); +void sbdrop (struct sbuf *,int ); +void sbreserve (struct sbuf *,int ); +void sbappend (struct socket *,struct mbuf *); +void sbcopy (struct sbuf *,int ,int ,char *);#endif
slirp/slirp.h +28 -28
90 lines not on this page · raw message
slirp/socket.h +14 -14
@@ -74,20 +74,20 @@ struct socket {#define SS_HOSTFWD 0x1000/* Socket describes host->guest forwarding */ #define SS_INCOMING 0x2000/* Connection was initiated by a host on the internet */ -struct socket * solookup _P((struct socket *, struct in_addr, u_int, struct in_addr, u_int)); -struct socket * socreate _P((Slirp *)); -void sofree _P((struct socket *)); -int soread _P((struct socket *)); -void sorecvoob _P((struct socket *)); -int sosendoob _P((struct socket *)); -int sowrite _P((struct socket *)); -void sorecvfrom _P((struct socket *)); -int sosendto _P((struct socket *, struct mbuf *)); -struct socket * tcp_listen _P((Slirp *, u_int32_t, u_int, u_int32_t, u_int, - int)); -void soisfconnecting _P((register struct socket *)); -void soisfconnected _P((register struct socket *)); -void sofwdrain _P((struct socket *)); +struct socket *solookup (struct socket *,struct in_addr ,u_int ,struct in_addr ,u_int ); +struct socket *socreate (Slirp *); +void sofree (struct socket *); +int soread (struct socket *); +void sorecvoob (struct socket *); +int sosendoob (struct socket *); +int sowrite (struct socket *); +void sorecvfrom (struct socket *); +int sosendto (struct socket *,struct mbuf *); +struct socket *tcp_listen (Slirp *,u_int32_t ,u_int ,u_int32_t ,u_int , +int ); +void soisfconnecting (registerstruct socket *); +void soisfconnected (registerstruct socket *); +void sofwdrain (struct socket *);struct iovec ;/* For win32 */ size_t sopreprbuf (struct socket *so,struct iovec *iov,int *np);int soreadbuf (struct socket *so,const char *buf,int size);
slirp/tcp_timer.h +3 -3
@@ -120,8 +120,8 @@ extern const int tcp_backoff[];struct tcpcb ; -void tcp_fasttimo _P((Slirp *)); -void tcp_slowtimo _P((Slirp *)); -void tcp_canceltimers _P((struct tcpcb *)); +void tcp_fasttimo (Slirp *); +void tcp_slowtimo (Slirp *); +void tcp_canceltimers (struct tcpcb *);#endif
slirp/udp.h +7 -7
@@ -73,13 +73,13 @@ struct udpiphdr {struct mbuf ; -void udp_init _P((Slirp *)); -void udp_input _P((register struct mbuf *, int)); -int udp_output _P((struct socket *, struct mbuf *, struct sockaddr_in *)); -int udp_attach _P((struct socket *)); -void udp_detach _P((struct socket *)); -struct socket * udp_listen _P((Slirp *, u_int32_t, u_int, u_int32_t, u_int, - int)); +void udp_init (Slirp *); +void udp_input (registerstruct mbuf *,int ); +int udp_output (struct socket *,struct mbuf *,struct sockaddr_in *); +int udp_attach (struct socket *); +void udp_detach (struct socket *); +struct socket *udp_listen (Slirp *,u_int32_t ,u_int ,u_int32_t ,u_int , +int );int udp_output2 (struct socket *so,struct mbuf *m,struct sockaddr_in *saddr,struct sockaddr_in *daddr,int iptos);