netinet/in: Use the GCC4 builtin byteswap functions for htonl.
Fixes the build breakage caused by PulkoMandy's recent commit. Remove these from ByteOrder.h now also, as per POSIX they should come from netinet/in.h. This is a small source compatibility breakage, but it will only affect a small portion of non-POSIX, partially-Be applications.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2007 Haiku, Inc. All rights reserved.
|
||||
* Copyright 2007, Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _BYTE_ORDER_H
|
||||
@@ -23,14 +23,6 @@ typedef enum {
|
||||
} swap_action;
|
||||
|
||||
|
||||
/* BSD/networking macros */
|
||||
#ifndef htonl
|
||||
# define htonl(x) B_HOST_TO_BENDIAN_INT32(x)
|
||||
# define ntohl(x) B_BENDIAN_TO_HOST_INT32(x)
|
||||
# define htons(x) B_HOST_TO_BENDIAN_INT16(x)
|
||||
# define ntohs(x) B_BENDIAN_TO_HOST_INT16(x)
|
||||
#endif
|
||||
|
||||
/* always swap macros */
|
||||
#define B_SWAP_DOUBLE(arg) __swap_double(arg)
|
||||
#define B_SWAP_FLOAT(arg) __swap_float(arg)
|
||||
|
||||
Reference in New Issue
Block a user