Resolve _WINSOCKAPI_ and WIN32_LEAN_AND_MEAN hell. Hopefully!

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2023-08-25 03:56:27 +02:00
parent fb48db73c1
commit 2c2680dfb3
4 changed files with 4 additions and 6 deletions

View File

@ -80,6 +80,7 @@
<EnablePREfast>true</EnablePREfast>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>..\include;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp17</LanguageStandard>

View File

@ -5,9 +5,6 @@
#pragma once
#define SECURITY_WIN32
#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
#include <stdex/base64.hpp>
#include <stdex/errno.hpp>
#include <stdex/exception.hpp>

View File

@ -15,8 +15,10 @@
#include <stdarg.h>
#include <stdint.h>
#ifdef _WIN32
#ifndef _WINSOCKAPI_
#include <winsock2.h>
#include <ws2ipdef.h>
#endif
#else
#include <inaddr.h>
#include <in6addr.h>

View File

@ -16,7 +16,7 @@
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#if defined(_WIN32) && !defined(WIN32_LEAN_AND_MEAN)
#if defined(_WIN32)
#include <asptlb.h>
#include <objidl.h>
#endif
@ -2278,7 +2278,6 @@ namespace stdex
ISequentialStream* m_source;
};
#ifndef WIN32_LEAN_AND_MEAN
///
/// Wrapper for IIS ASP IRequest and IResponse
///
@ -2395,7 +2394,6 @@ namespace stdex
IRequest* m_request;
IResponse* m_response;
};
#endif
#endif
///