Commit 99684bc4 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

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

parent 79ebd3f3
...@@ -519,10 +519,18 @@ int WINAPI __WSAFDIsSet(SOCKET,WS(fd_set)*); ...@@ -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) ...@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment