[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Fix windows compile.



Update of /home/or/cvsroot/src/common
In directory moria.mit.edu:/tmp/cvs-serv18782/src/common

Modified Files:
	fakepoll.c util.c 
Log Message:
Fix windows compile.

Index: fakepoll.c
===================================================================
RCS file: /home/or/cvsroot/src/common/fakepoll.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- fakepoll.c	2 May 2004 20:17:43 -0000	1.24
+++ fakepoll.c	2 May 2004 20:23:35 -0000	1.25
@@ -25,7 +25,8 @@
 #include <ws2tcpip.h>
 #elif defined(_MSC_VER)
 #include <winsock.h>
-#endif
+#endif
+#include <assert.h>
 
 /* by default, windows handles only 64 fd's */
 #if defined(MS_WINDOWS) && !defined(FD_SETSIZE)

Index: util.c
===================================================================
RCS file: /home/or/cvsroot/src/common/util.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- util.c	2 May 2004 20:18:21 -0000	1.98
+++ util.c	2 May 2004 20:23:35 -0000	1.99
@@ -13,7 +13,7 @@
 #define WIN32_WINNT 0x400
 #define _WIN32_WINNT 0x400
 #define WIN32_LEAN_AND_MEAN
-#if _MSC_VER > 1300
+#if _MSC_VER > 1300
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #elif defined(_MSC_VER)
@@ -1116,7 +1116,7 @@
  */
 #ifdef MS_WINDOWS
 #define E(code, s) { code, (s " [" #code " ]") }
-struct { int code; char *msg; } windows_socket_errors = {
+struct { int code; const char *msg; } windows_socket_errors[] = {
   E(WSAEINTR, "Interrupted function call"),
   E(WSAEACCES, "Permission denied"),
   E(WSAEFAULT, "Bad address"),
@@ -1128,19 +1128,19 @@
   E(WSAENOTSOCK, "Socket operation on nonsocket"),
   E(WSAEDESTADDRREQ, "Destination address required"),
   E(WSAEMSGSIZE, "Message too long"),
-  E(WASEPROTOTYPE, "Protocol wrong for socket"),
+  E(WSAEPROTOTYPE, "Protocol wrong for socket"),
   E(WSAENOPROTOOPT, "Bad protocol option"),
   E(WSAEPROTONOSUPPORT, "Protocol not supported"),
   E(WSAESOCKTNOSUPPORT, "Socket type not supported"),
   /* What's the difference between NOTSUPP and NOSUPPORT? :) */
-  E(WASEOPNOTSUPP, "Operation not supported"),
+  E(WSAEOPNOTSUPP, "Operation not supported"),
   E(WSAEPFNOSUPPORT,  "Protocol family not supported"),
   E(WSAEAFNOSUPPORT, "Address family not supported by protocol family"),
   E(WSAEADDRINUSE, "Address already in use"),
   E(WSAEADDRNOTAVAIL, "Cannot assign requested address"),
   E(WSAENETDOWN, "Network is down"),
   E(WSAENETUNREACH, "Network is unreachable"),
-  E(WSAENETRESET, "Network dropped connection on reset")
+  E(WSAENETRESET, "Network dropped connection on reset"),
   E(WSAECONNABORTED, "Software caused connection abort"),
   E(WSAECONNRESET, "Connection reset by peer"),
   E(WSAENOBUFS, "No buffer space avaialable"),
@@ -1156,8 +1156,10 @@
   E(WSASYSNOTREADY, "Network subsystem is unavailable"),
   E(WSAVERNOTSUPPORTED, "Winsock.dll out of range"),
   E(WSANOTINITIALISED, "Successful WSAStartup not yet performed"),
-  E(WSAEDISCONN, "Graceful shutdown no in progress"),
-  E(WSATYPE_NOT_FOUND, "Class type not found"),
+  E(WSAEDISCON, "Graceful shutdown now in progress"),
+#ifdef WSATYPE_NOT_FOUND
+  E(WSATYPE_NOT_FOUND, "Class type not found"),
+#endif
   E(WSAHOST_NOT_FOUND, "Host not found"),
   E(WSATRY_AGAIN, "Nonauthoritative host not found"),
   E(WSANO_RECOVERY, "This is a nonrecoverable error"),