Define WIN32_LEAN_AND_MEAN before #include <windows.h>

Otherwise, winsock.h is implicitly #included by the Win32 API, which
might then conflict with winsock2.h.


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9543 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 804a2f7686eef1b656a63225cbda4f89d7b36639
Former-commit-id: e52e533be7785034b1fdebad19bce1e9940c26f8
This commit is contained in:
xavi92 2024-08-15 22:09:22 +00:00
parent 707bd2e28b
commit d43f9b039a
4 changed files with 8 additions and 0 deletions

View file

@ -8,6 +8,7 @@
* (at your option) any later version.
*/
#define WIN32_LEAN_AND_MEAN
#include "portability.h"
#include <windows.h>
#include <wincrypt.h>

View file

@ -8,6 +8,7 @@
* (at your option) any later version.
*/
#define WIN32_LEAN_AND_MEAN
#include "portability.h"
#include <windows.h>

View file

@ -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 <windows.h>
#define SOHandle(h) ((HMODULE)(h))
#else

View file

@ -29,6 +29,8 @@
#include "tgf.hpp"
#ifdef WIN32
/* Prevent inclusion of winsock.h in windows.h */
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
# define dlopen(pszShLibFileName) (void*)LoadLibrary(pszShLibFileName)
# define dlsym(pvHandle, pszFuncName) GetProcAddress((HMODULE)pvHandle, pszFuncName)