diff --git a/src/libs/portability/win32/rand.cpp b/src/libs/portability/win32/rand.cpp index 53fb59a3d..0fd8f6f4a 100644 --- a/src/libs/portability/win32/rand.cpp +++ b/src/libs/portability/win32/rand.cpp @@ -8,6 +8,7 @@ * (at your option) any later version. */ +#define WIN32_LEAN_AND_MEAN #include "portability.h" #include #include diff --git a/src/libs/portability/win32/rmdir_r.cpp b/src/libs/portability/win32/rmdir_r.cpp index 702e93ad4..cca9f3e21 100644 --- a/src/libs/portability/win32/rmdir_r.cpp +++ b/src/libs/portability/win32/rmdir_r.cpp @@ -8,6 +8,7 @@ * (at your option) any later version. */ +#define WIN32_LEAN_AND_MEAN #include "portability.h" #include diff --git a/src/libs/tgf/modinfo.h b/src/libs/tgf/modinfo.h index 582b63989..60c28b55f 100644 --- a/src/libs/tgf/modinfo.h +++ b/src/libs/tgf/modinfo.h @@ -87,6 +87,10 @@ typedef struct ModInfoNC { typedef void* tSOHandle; #ifdef WIN32 +#ifndef WIN32_LEAN_AND_MEAN +/* Prevent inclusion of winsock.h in windows.h */ +#define WIN32_LEAN_AND_MEAN +#endif #include #define SOHandle(h) ((HMODULE)(h)) #else diff --git a/src/libs/tgf/module.cpp b/src/libs/tgf/module.cpp index 4c13c04b0..f62310e26 100644 --- a/src/libs/tgf/module.cpp +++ b/src/libs/tgf/module.cpp @@ -29,6 +29,8 @@ #include "tgf.hpp" #ifdef WIN32 +/* Prevent inclusion of winsock.h in windows.h */ +#define WIN32_LEAN_AND_MEAN #include # define dlopen(pszShLibFileName) (void*)LoadLibrary(pszShLibFileName) # define dlsym(pvHandle, pszFuncName) GetProcAddress((HMODULE)pvHandle, pszFuncName)