include: Allow programs to take the address of byte-swapping functions.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2017-08-17 09:11:57 -06:00 committed by Alexandre Julliard
parent 79ebd3f3bf
commit 99684bc425

View file

@ -519,10 +519,18 @@ int WINAPI __WSAFDIsSet(SOCKET,WS(fd_set)*);
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
#define htonl(l) ((ULONG)(l)) static inline u_short __wine_ushort_noop(u_short s)
#define htons(s) ((u_short)(s)) {
#define ntohl(l) ((ULONG)(l)) return s;
#define ntohs(s) ((u_short)(s)) }
static inline ULONG __wine_ulong_noop(ULONG l)
{
return l;
}
#define htonl __wine_ulong_noop
#define htons __wine_ushort_noop
#define ntohl __wine_ulong_noop
#define ntohs __wine_ushort_noop
#else /* WORDS_BIGENDIAN */ #else /* WORDS_BIGENDIAN */
@ -534,10 +542,10 @@ static inline ULONG __wine_ulong_swap(ULONG l)
{ {
return ((ULONG)__wine_ushort_swap((u_short)l) << 16) | __wine_ushort_swap((u_short)(l >> 16)); return ((ULONG)__wine_ushort_swap((u_short)l) << 16) | __wine_ushort_swap((u_short)(l >> 16));
} }
#define htonl(l) __wine_ulong_swap(l) #define htonl __wine_ulong_swap
#define htons(s) __wine_ushort_swap(s) #define htons __wine_ushort_swap
#define ntohl(l) __wine_ulong_swap(l) #define ntohl __wine_ulong_swap
#define ntohs(s) __wine_ushort_swap(s) #define ntohs __wine_ushort_swap
#endif /* WORDS_BIGENDIAN */ #endif /* WORDS_BIGENDIAN */