One of the most irritating things about cross-platform programming is that so many of the differences between systems are utterly pointless. Witness the header files you have to include to get the standard network-byte-order to host-byte-order functions into your library:
Solaris: #include <sys/types.h> #include <netinet/in.h> #include <inttypes.h> Linux: #include <netinet/in.h> Mac OS X: #include <arpa/inet.h> OpenBSD: #include <sys/types.h> FreeBSD: #include <arpa/inet.h> or #include <netinet/in.h>
How stupid is that? netinet/in.h looks like it almost might work, but in reality there are many supporting functions that cause all hell to break loose if you don't use these particular sets of include files. Once the lack of a long long network/host byte conversion routine gets thrown in, it's easier just to roll your own, which is what I ended up doing a few months ago for one of the libraries I work on.