[_WIN32]: Add #define WIN32 whereever winsock2.h is used. There is bug

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.
This commit is contained in:
Ron Koenderink 2005-03-20 11:07:45 +00:00
parent 4bb4376a57
commit f826221a58
4 changed files with 4 additions and 0 deletions

View file

@ -52,6 +52,7 @@
#include <stdlib.h> /* malloc calloc free */
#if defined(_WIN32)
#define WIN32
#include <winsock2.h>
#undef NS_ALL
#endif