* net.cc: Include asm/byteorder.h.

(htonl): Move to end of file.  Add comment to explain why.  Align
	definition to POSIX.  Use related macro from asm/byteorder.h.
	(ntohl): Ditto.
	(htons): Ditto.
	(ntohs): Ditto.
	* include/asm/byteorder.h: Revert previous patch.
This commit is contained in:
Corinna Vinschen
2009-03-03 11:44:18 +00:00
parent ed296a4727
commit 2895b8b502
3 changed files with 50 additions and 35 deletions

View File

@ -70,8 +70,7 @@ __ntohs(uint16_t x)
#define __constant_htonl(x) __constant_ntohl(x)
#define __constant_htons(x) __constant_ntohs(x)
#if defined (__OPTIMIZE__) && !defined (__NO_INLINE__) \
&& !defined (__INSIDE_CYGWIN_NET__)
#if defined (__OPTIMIZE__) && !defined (__NO_INLINE__)
# define ntohl(x) \
(__builtin_constant_p((long)(x)) ? \
__constant_ntohl((x)) : \