Forráskód Böngészése

Fix re-definition issue of winsock.h and winsock2.h

Jisi Liu 9 éve
szülő
commit
203bb5eb33
1 módosított fájl, 1 hozzáadás és 0 törlés
  1. 1 0
      src/google/protobuf/map_test.cc

+ 1 - 0
src/google/protobuf/map_test.cc

@@ -31,6 +31,7 @@
 // A hack to include windows.h first, which ensures the GetMessage macro can
 // A hack to include windows.h first, which ensures the GetMessage macro can
 // be undefined when we include <google/protobuf/stubs/common.h>
 // be undefined when we include <google/protobuf/stubs/common.h>
 #if defined(_WIN32)
 #if defined(_WIN32)
+#define _WINSOCKAPI_  // to avoid re-definition in WinSock2.h
 #include <windows.h>
 #include <windows.h>
 #endif  // _WIN32
 #endif  // _WIN32