This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

htonl, htons, ntohl and ntohs types


Hello

I have noticed that the types of the functions htonl, htons, ntohs and
ntohl differs from standard (and linux):

http://www.opengroup.org/onlinepubs/000095399/functions/htonl.html

Cygwin uses:

unsigned long int        ntohl(unsigned long int);
unsigned short int       ntohs(unsigned short int);
unsigned long int        htonl(unsigned long int);
unsigned short int       htons(unsigned short int);

The standard (and Linux) has:

uint32_t htonl(uint32_t hostlong);
uint16_t htons(uint16_t hostshort);
uint32_t ntohl(uint32_t netlong);
uint16_t ntohs(uint16_t netshort);

Is there any reason for this difference?

The difference in the api gives me warnings when porting code from
Linux to Cygwin.

Thanks
Lars Munch

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]