diff options
author | Ulrich Drepper <drepper@redhat.com> | 1997-03-05 21:06:12 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1997-03-05 21:06:12 +0000 |
commit | 4db14580ca346d7a59c7fbc3143d8c9130fe146b (patch) | |
tree | 612a1423723fffde900a51c75969c003760f3104 /sysdeps/generic | |
parent | 379091f89dbef52841b270d8b3042c264f54e603 (diff) |
(htonl, htons, ntohl, ntohs): Change prototypes to use types with
explicit width. `unsigned long' is different on 64 bit systems.
Diffstat (limited to 'sysdeps/generic')
-rw-r--r-- | sysdeps/generic/netinet/in.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sysdeps/generic/netinet/in.h b/sysdeps/generic/netinet/in.h index ad77c8be7d..5531fc2ece 100644 --- a/sysdeps/generic/netinet/in.h +++ b/sysdeps/generic/netinet/in.h @@ -190,12 +190,17 @@ struct ip_mreq struct in_addr imr_interface; /* local IP address of interface */ }; -/* Functions to convert between host and network byte order. */ +/* Functions to convert between host and network byte order. -extern unsigned long int ntohl __P ((unsigned long int)); -extern unsigned short int ntohs __P ((unsigned short int)); -extern unsigned long int htonl __P ((unsigned long int)); -extern unsigned short int htons __P ((unsigned short int)); + Please note that these functions normally take `unsigned long int' or + `unsigned short int' values as arguments and also return them. But + this was a short-sighted decision since on different systems the types + may have different representations but the values are always the same. */ + +extern u_int32_t ntohl __P ((u_int32_t __netlong)); +extern u_int16_t ntohs __P ((u_int16_t __netshort)); +extern u_int32_t htonl __P ((u_int32_t __hostlong)); +extern u_int16_t htons __P ((u_int16_t __hostshort)); #include <endian.h> |