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.
#include "prototypes.h"
#if defined(_WIN32) && defined(_EMPTH_WIN32)
+#define WIN32
#include <winsock2.h>
#undef NS_ALL
#include <windows.h>
#include <stdlib.h> /* malloc calloc free */
#if defined(_WIN32)
+#define WIN32
#include <winsock2.h>
#undef NS_ALL
#endif
*/
#if defined(_WIN32)
+#define WIN32
#include <winsock2.h>
#undef NS_ALL
#endif
#include <string.h>
#if defined(_WIN32)
+#define WIN32
#include <winsock2.h>
#undef NS_ALL
#include <process.h>