]> git.pond.sub.org Git - empserver/commitdiff
[_WIN32]: Add #define WIN32 whereever winsock2.h is used. There is bug
authorRon Koenderink <rkoenderink@yahoo.ca>
Sun, 20 Mar 2005 11:07:45 +0000 (11:07 +0000)
committerRon Koenderink <rkoenderink@yahoo.ca>
Sun, 20 Mar 2005 11:07:45 +0000 (11:07 +0000)
in the VC7 version of winsock2.h.  In version VC7, the #pragma
pack(push) and pack(pop) have an #ifdef !WIN32 add to them.  However,
if WIN32 is not defined at the beginning, the push is done but by the
time the pop is reach something else has set WIN32 define so the pop
is not done, and it changes the default pack from /Zp2 to /Zp4, which
makes the data structures incompatible between objects with winsock2.h
and without winsock2.h.  By adding the WIN32 both the push and pop are
not done.

src/lib/empthread/ntthread.c
src/lib/gen/io.c
src/lib/player/accept.c
src/server/main.c

index 38e43c5149f886c65cf849b6f7405a58d826f34c..8412bbfd3ad9bbbc24ea9ef3d73d91d70dc52ae1 100644 (file)
@@ -53,6 +53,7 @@
 #include "prototypes.h"
 
 #if defined(_WIN32) && defined(_EMPTH_WIN32)
+#define WIN32
 #include <winsock2.h>
 #undef NS_ALL
 #include <windows.h>
index 78121b27814aae91f3b165815c273fa9a9a8420a..983eccb1fd243b71fde939697817d48f201849a1 100644 (file)
@@ -52,6 +52,7 @@
 #include <stdlib.h>            /* malloc calloc free */
 
 #if defined(_WIN32)
+#define WIN32
 #include <winsock2.h>
 #undef NS_ALL
 #endif
index c74c476285545a2e0ff98cf8906b7caec492e6ea..8460e95d7cd4d8a94291efb7220e57af17d1afe4 100644 (file)
@@ -32,6 +32,7 @@
  */
 
 #if defined(_WIN32)
+#define WIN32
 #include <winsock2.h>
 #undef NS_ALL
 #endif
index 1492c87861a0b041513e98410ca1c1d1e202b843..27862cfb3af9c93d8e5b03b13aedda54280d9a93 100644 (file)
@@ -43,6 +43,7 @@
 #include <string.h>
 
 #if defined(_WIN32)
+#define WIN32
 #include <winsock2.h>
 #undef NS_ALL
 #include <process.h>