From 2c2680dfb3915d701f53318bb0b3e46c1f62accf Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 25 Aug 2023 03:56:27 +0200 Subject: [PATCH] Resolve _WINSOCKAPI_ and WIN32_LEAN_AND_MEAN hell. Hopefully! Signed-off-by: Simon Rozman --- UnitTests/UnitTests.vcxproj | 1 + UnitTests/pch.h | 3 --- include/stdex/parser.hpp | 2 ++ include/stdex/stream.hpp | 4 +--- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/UnitTests/UnitTests.vcxproj b/UnitTests/UnitTests.vcxproj index 55a7a5d5d..3bd737b38 100644 --- a/UnitTests/UnitTests.vcxproj +++ b/UnitTests/UnitTests.vcxproj @@ -80,6 +80,7 @@ true true ..\include;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) true pch.h stdcpp17 diff --git a/UnitTests/pch.h b/UnitTests/pch.h index 472527b48..668abe607 100644 --- a/UnitTests/pch.h +++ b/UnitTests/pch.h @@ -5,9 +5,6 @@ #pragma once -#define SECURITY_WIN32 -#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h - #include #include #include diff --git a/include/stdex/parser.hpp b/include/stdex/parser.hpp index ce69bee8e..8bced4fdc 100644 --- a/include/stdex/parser.hpp +++ b/include/stdex/parser.hpp @@ -15,8 +15,10 @@ #include #include #ifdef _WIN32 +#ifndef _WINSOCKAPI_ #include #include +#endif #else #include #include diff --git a/include/stdex/stream.hpp b/include/stdex/stream.hpp index 305cb80e2..08fafc883 100644 --- a/include/stdex/stream.hpp +++ b/include/stdex/stream.hpp @@ -16,7 +16,7 @@ #include #include #include -#if defined(_WIN32) && !defined(WIN32_LEAN_AND_MEAN) +#if defined(_WIN32) #include #include #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 ///