fix include/winsock.h compiling on NetBSD

Yorick Hardy yh at metroweb.co.za
Sat Apr 12 06:09:15 CDT 2003


Below is a very ugly hack to get winsock.h compiling on NetBSD again,
due to the fact that htonl is redefined when sys/types.h is included.

In other words the original #define htonl unix_htonl is undone before
the definition of htonl under NetBSD.

-- 
Yorick Hardy

--- include/winsock.h	Sat Apr  5 12:32:20 2003
+++ include/winsock.h	Fri Apr 11 12:23:08 2003
@@ -77,10 +77,10 @@
 #  undef fd_set
 #  undef timeval
 #  undef select
-#  undef htonl
-#  undef htons
-#  undef ntohl
-#  undef ntohs
+#  define htonl WS_htonl
+#  define htons WS_htons
+#  define ntohl WS_ntohl
+#  define ntohs WS_ntohs
 #  undef FD_SETSIZE
 #  undef FD_CLR
 #  undef FD_SET
@@ -481,10 +481,10 @@
 #define WS_FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (WS_fd_set*)(set))
 #endif
 
-u_long WINAPI WS(htonl)(u_long);
-u_short WINAPI WS(htons)(u_short);
-u_long WINAPI WS(ntohl)(u_long);
-u_short WINAPI WS(ntohs)(u_short);
+u_long WINAPI WS_htonl(u_long);
+u_short WINAPI WS_htons(u_short);
+u_long WINAPI WS_ntohl(u_long);
+u_short WINAPI WS_ntohs(u_short);
 
 #endif /* WS_DEFINE_SELECT */
 



More information about the wine-patches mailing list