* include/asm/byteorder.h (__ntohl): Prototype before define to avoid

a warning with -Wmissing-prototypes.  Use _ELIDABLE_INLINE macro from
	_ansi.h.
	(__ntohs): Ditto.
This commit is contained in:
Corinna Vinschen 2009-04-04 15:49:05 +00:00
parent 56c5c08a5d
commit 4fedce119c
2 changed files with 14 additions and 8 deletions

View File

@ -1,3 +1,11 @@
2009-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Corinna Vinschen <corinna@vinschen.de>
* include/asm/byteorder.h (__ntohl): Prototype before define to avoid
a warning with -Wmissing-prototypes. Use _ELIDABLE_INLINE macro from
_ansi.h.
(__ntohs): Ditto.
2009-04-02 Corinna Vinschen <corinna@vinschen.de>
* environ.cc (build_env): Fix length calculation of resulting

View File

@ -11,6 +11,7 @@ details. */
#ifndef _I386_BYTEORDER_H
#define _I386_BYTEORDER_H
#include <_ansi.h>
#include <stdint.h>
#ifdef __cplusplus
@ -30,10 +31,10 @@ extern uint16_t ntohs(uint16_t);
extern uint32_t htonl(uint32_t);
extern uint16_t htons(uint16_t);
#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
extern
#endif
__inline__ uint32_t
_ELIDABLE_INLINE uint32_t __ntohl(uint32_t);
_ELIDABLE_INLINE uint16_t __ntohs(uint16_t);
_ELIDABLE_INLINE uint32_t
__ntohl(uint32_t x)
{
__asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */
@ -50,10 +51,7 @@ __ntohl(uint32_t x)
(((uint32_t)(x) & 0x00ff0000U) >> 8) | \
(((uint32_t)(x) & 0xff000000U) >> 24)))
#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
extern
#endif
__inline__ uint16_t
_ELIDABLE_INLINE uint16_t
__ntohs(uint16_t x)
{
__asm__("xchgb %b0,%h0" /* swap bytes */