[_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:
parent
4bb4376a57
commit
f826221a58
4 changed files with 4 additions and 0 deletions
|
@ -53,6 +53,7 @@
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
|
|
||||||
#if defined(_WIN32) && defined(_EMPTH_WIN32)
|
#if defined(_WIN32) && defined(_EMPTH_WIN32)
|
||||||
|
#define WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#undef NS_ALL
|
#undef NS_ALL
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
#include <stdlib.h> /* malloc calloc free */
|
#include <stdlib.h> /* malloc calloc free */
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
|
#define WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#undef NS_ALL
|
#undef NS_ALL
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
|
#define WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#undef NS_ALL
|
#undef NS_ALL
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
|
#define WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#undef NS_ALL
|
#undef NS_ALL
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue