diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-03-26 10:40:29 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-03-26 10:40:29 +0000 |
commit | 62818522c28889ec74447601709bc2181b1cf333 (patch) | |
tree | 8c399c46a9b777e26221848b419a4a123ed6af3d | |
parent | 2aaa53221b0eee4e4a1b03508c39880e8ab1d99a (diff) | |
download | cygnal-62818522c28889ec74447601709bc2181b1cf333.tar.gz cygnal-62818522c28889ec74447601709bc2181b1cf333.tar.bz2 cygnal-62818522c28889ec74447601709bc2181b1cf333.zip |
* include/asm/byteorder.h (__ntohl): Align definition to ISO C99.
(__ntohs): Ditto.
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/include/asm/byteorder.h | 13 |
2 files changed, 13 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 8e3470e38..6f2c81404 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2009-03-26 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/asm/byteorder.h (__ntohl): Align definition to ISO C99. + (__ntohs): Ditto. + 2009-03-26 Corinna Vinschen <corinna@vinschen.de> * strfuncs.cc (__set_charset_from_codepage): Revert to translating diff --git a/winsup/cygwin/include/asm/byteorder.h b/winsup/cygwin/include/asm/byteorder.h index 9a274dd2e..8e9fbaa11 100644 --- a/winsup/cygwin/include/asm/byteorder.h +++ b/winsup/cygwin/include/asm/byteorder.h @@ -30,10 +30,10 @@ extern uint16_t ntohs(uint16_t); extern uint32_t htonl(uint32_t); extern uint16_t htons(uint16_t); -extern __inline__ uint32_t __ntohl(uint32_t); -extern __inline__ uint16_t __ntohs(uint16_t); - -extern __inline__ uint32_t +#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__) +extern +#endif +__inline__ uint32_t __ntohl(uint32_t x) { __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */ @@ -50,7 +50,10 @@ __ntohl(uint32_t x) (((uint32_t)(x) & 0x00ff0000U) >> 8) | \ (((uint32_t)(x) & 0xff000000U) >> 24))) -extern __inline__ uint16_t +#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__) +extern +#endif +__inline__ uint16_t __ntohs(uint16_t x) { __asm__("xchgb %b0,%h0" /* swap bytes */ |