Im trying to get some of my code compiling on more and more platforms, im having trouble with the FreeBSD headers. Right now im using:

Code:
#include <netinet/in.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <cerrno>
#include <netdb.h>
#include <arpa/inet.h>
And its spewing errors:

Code:
some-box# gcc -o AI_RUN main.cpp -lpthread
In file included from ../Wrapper Classes/sockets_nix.h:7,
                 from ../Wrapper Classes/sockets.h:44,
                 from botclass.h:22,
                 from main.cpp:6:
/usr/include/netinet/in.h:235: syntax error before `;'
/usr/include/netinet/in.h:287: syntax error before `;'
In file included from /usr/include/netinet/in.h:469,
                 from ../Wrapper Classes/sockets_nix.h:7,
                 from ../Wrapper Classes/sockets.h:44,
                 from botclass.h:22,
                 from main.cpp:6:
/usr/include/netinet6/in6.h:122: syntax error before `['
/usr/include/netinet6/in6.h:144: syntax error before `;'
/usr/include/netinet6/in6.h:149: syntax error before `;'
/usr/include/netinet6/in6.h:612: syntax error before `*'
/usr/include/netinet6/in6.h:614: syntax error before `*'
/usr/include/netinet6/in6.h:615: syntax error before `*'
/usr/include/netinet6/in6.h:616: syntax error before `*'
/usr/include/netinet6/in6.h:631: type specifier omitted for parameter
/usr/include/netinet6/in6.h:632: type specifier omitted for parameter
/usr/include/netinet6/in6.h:636: syntax error before `*'
/usr/include/netinet6/in6.h:638: type specifier omitted for parameter
In file included from ../Wrapper Classes/sockets.h:44,
                 from botclass.h:22,
                 from main.cpp:6:
../Wrapper Classes/sockets_nix.h: In method `bool Socket::listen(short unsigned int, int = 128)':
../Wrapper Classes/sockets_nix.h:116: `struct sockaddr_in' has no member named `sin_family'
../Wrapper Classes/sockets_nix.h:117: `struct sockaddr_in' has no member named `sin_port'
../Wrapper Classes/sockets_nix.h:118: `struct in_addr' has no member named `s_addr'
../Wrapper Classes/sockets_nix.h: In method `bool Socket::connect(const char *, short unsigned int)':
../Wrapper Classes/sockets_nix.h:164: `struct sockaddr_in' has no member named `sin_family'
../Wrapper Classes/sockets_nix.h:165: `struct sockaddr_in' has no member named `sin_port'
Am I including the wrong headers for this platform? Im assuming eventhough headers might be named different, that the functions like connect() take the same parameters.


Thanks for your time guys.