Drop usage of old-age BSD types in generically used Cygwin headers

u_char, u_short, u_int, u_long are BSD-only types.  Remove them from
Cygwin headers which are supposed to be used in a non-BSD scenario.
Drop special Cygwin handling of those types in sys/types.h.

newlib:
	* libc/include/sys/types.h (u_char,u_short,u_int,u_long): Drop
	Cygwin exception.

cygwin:
	* fhandler_socket.cc (fhandler_socket::ioctl): Accommodate change
	in include/asm/socket.h.  Continue using u_long since that's the
	MS type here.
	* include/asm/socket.h: Since the type given in _IOR/_IOW macros
	is only used for its sizeof, replace u_long with equivalent long.
	* netdb.h (getnetbyaddr): Fix prototype.
	* netinet/ip.h: Replace old BSD-only types with generically defined
	old BSD types (u_char -> u_int8_t, etc).
	* netinet/tcp.h: Ditto.
	* netinet/udp.h: Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2016-03-24 14:03:40 +01:00
parent db5bfdbd8a
commit b1b46d4580
7 changed files with 48 additions and 49 deletions

View File

@ -52,28 +52,28 @@
*/
struct ip {
#ifdef _IP_VHL
u_char ip_vhl; /* version << 4 | header length >> 2 */
u_int8_t ip_vhl; /* version << 4 | header length >> 2 */
#else
#if __BYTE_ORDER == __LITTLE_ENDIAN
u_int ip_hl:4, /* header length */
ip_v:4; /* version */
unsigned int ip_hl:4, /* header length */
ip_v:4; /* version */
#endif
#if __BYTE_ORDER == __BIG_ENDIAN
u_int ip_v:4, /* version */
ip_hl:4; /* header length */
unsigned int ip_v:4, /* version */
ip_hl:4; /* header length */
#endif
#endif /* not _IP_VHL */
u_char ip_tos; /* type of service */
u_short ip_len; /* total length */
u_short ip_id; /* identification */
u_short ip_off; /* fragment offset field */
u_int_8 ip_tos; /* type of service */
u_int16_t ip_len; /* total length */
u_int16_t ip_id; /* identification */
u_int16_t ip_off; /* fragment offset field */
#define IP_RF 0x8000 /* reserved fragment flag */
#define IP_DF 0x4000 /* dont fragment flag */
#define IP_MF 0x2000 /* more fragments flag */
#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
u_char ip_ttl; /* time to live */
u_char ip_p; /* protocol */
u_short ip_sum; /* checksum */
u_int8_t ip_ttl; /* time to live */
u_int8_t ip_p; /* protocol */
u_int16_t ip_sum; /* checksum */
struct in_addr ip_src,ip_dst; /* source and dest address */
};
@ -208,16 +208,16 @@ struct ip {
* Time stamp option structure.
*/
struct ip_timestamp {
u_char ipt_code; /* IPOPT_TS */
u_char ipt_len; /* size of structure (variable) */
u_char ipt_ptr; /* index of current entry */
u_int8_t ipt_code; /* IPOPT_TS */
u_int8_t ipt_len; /* size of structure (variable) */
u_int8_t ipt_ptr; /* index of current entry */
#if __BYTE_ORDER == __LITTLE_ENDIAN
u_int ipt_flg:4, /* flags, see below */
ipt_oflw:4; /* overflow counter */
unsigned int ipt_flg:4, /* flags, see below */
ipt_oflw:4; /* overflow counter */
#endif
#if __BYTE_ORDER == __BIG_ENDIAN
u_int ipt_oflw:4, /* overflow counter */
ipt_flg:4; /* flags, see below */
unsigned int ipt_oflw:4, /* overflow counter */
ipt_flg:4; /* flags, see below */
#endif
union ipt_timestamp {
n_long ipt_time[1];