Bug 88936

Summary: Fail to build on FreeBSD because of missing includes
Product: Spice Reporter: Ting-Wei Lan <lantw44>
Component: usbredirAssignee: Hans de Goede <jwrdegoede>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: FreeBSD   
Whiteboard:
i915 platform: i915 features:

Description Ting-Wei Lan 2015-02-03 08:47:58 UTC
usbredir cannot be built on FreeBSD because of missing includes. Here is the error message:

usbredirserver.c:200:25: error: variable has incomplete type 'struct sockaddr_in6'
    struct sockaddr_in6 serveraddr;
                        ^
usbredirserver.c:200:12: note: forward declaration of 'struct sockaddr_in6'
    struct sockaddr_in6 serveraddr;
           ^
usbredirserver.c:287:30: warning: implicit declaration of function 'htons' is invalid in C99 [-Wimplicit-function-declaration]
    serveraddr.sin6_port   = htons(port);
                             ^
usbredirserver.c:288:30: error: use of undeclared identifier 'in6addr_any'
    serveraddr.sin6_addr   = in6addr_any;
                             ^
1 warning and 2 errors generated.

Patches to fix the problem are available in FreeBSD ports. I think we can remove #ifdef __FreeBSD__ in the patches.
https://svnweb.freebsd.org/ports/head/net/usbredir/files/
Comment 1 Hans de Goede 2015-02-03 08:58:01 UTC
Thanks for the bug report. I've just pushed a patch to usbredir git master adding the missing includes without the unnecessary #ifdefs.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.