Header file for u_short?
We just ramped up testing on less-frequently-used platforms. We ran into a similar issue under Cygwin i686 with GCC 5.3 and -std=c++11
. The code has been stable for about 15 years (give or take).
I can't find a standard header for it.
Grepping on OS X and Linux shows u_short
is fairly prevalent, even though there are 0 hits under Cygwin now (JUN 2016):
# Ununtu
$ grep -IR "u_short" /usr/include | wc -l
31
# OS X
$ grep -IR "u_short" /usr/include | wc -l
122
# Solaris
$ /usr/gnu/bin/grep -IR "u_short" /usr/include/ | wc -l
125
And:
# Ubuntu
$ grep -IR "u_short" /usr/include | grep typedef
/usr/include/x86_64-linux-gnu/bits/types.h:typedef unsigned short int __u_short;
/usr/include/x86_64-linux-gnu/sys/types.h:typedef __u_short u_short;
/usr/include/rpc/types.h:typedef __u_short u_short;
/usr/include/linux/coda.h:typedef unsigned short u_short;
# OS X
$ grep -IR "u_short" /usr/include | grep typedef
/usr/include/netinet/ip_mroute.h:typedef u_short vifi_t; /* type of a vif index */
/usr/include/netinet6/ip6_mroute.h:typedef u_short mifi_t; /* type of a mif index */
/usr/include/sys/types.h:typedef unsigned short u_short;
# Solaris
$ /usr/gnu/bin/grep -IR "u_short" /usr/include/ 2>/dev/null | grep typedef
/usr/include/sys/types.h:typedef unsigned short u_short;
/usr/include/rpcsvc/nfs_acl.h:typedef u_short o_mode;
You should be safe with a cast to unsigned short
or perhaps a uint16_t
(on Unix and Linux from <stdint.h>
) rather than u_short
.