From 2f7b9f5ae8be21c6c1d75ae9caefbc7b3f8986a9 Mon Sep 17 00:00:00 2001 From: Pablo Delgado Date: Thu, 16 Sep 2021 01:17:57 +0200 Subject: Fix incorrect WIN32 macros and missing Windows.h inclusion (#1939) * Replace WIN32 preprocessor macros with _WIN32 * Add missing Windows.h include for InterlockedIncrement --- source/core/slang-shared-library.cpp | 2 +- source/slang/slang-compiler.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/core/slang-shared-library.cpp b/source/core/slang-shared-library.cpp index 844bea8d9..a67b10a42 100644 --- a/source/core/slang-shared-library.cpp +++ b/source/core/slang-shared-library.cpp @@ -13,7 +13,7 @@ #endif #include #include -#ifndef WIN32 +#ifndef _WIN32 # include #endif diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp index 9f10876a0..c6c41b099 100644 --- a/source/slang/slang-compiler.cpp +++ b/source/slang/slang-compiler.cpp @@ -37,6 +37,14 @@ #include #endif +#ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN +#define NOMINMAX +#include +#undef WIN32_LEAN_AND_MEAN +#undef NOMINMAX +#endif + #ifdef _MSC_VER #pragma warning(disable: 4996) #endif @@ -2291,7 +2299,7 @@ namespace Slang // really need/want to do anything too elaborate static uint32_t counter = 0; -#ifdef WIN32 +#ifdef _WIN32 uint32_t id = InterlockedIncrement(&counter); #else // TODO: actually implement the case for other platforms -- cgit v1.2.3