summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-compiler.cpp
diff options
context:
space:
mode:
authorPablo Delgado <private@pablode.com>2021-09-16 01:17:57 +0200
committerGitHub <noreply@github.com>2021-09-15 16:17:57 -0700
commit2f7b9f5ae8be21c6c1d75ae9caefbc7b3f8986a9 (patch)
treef41d7e7ce0e628744a33d8cfc9a79ab7e4cb87c1 /source/slang/slang-compiler.cpp
parent11d43642008905ac69a3832eb8a9b2ae7b785f86 (diff)
Fix incorrect WIN32 macros and missing Windows.h inclusion (#1939)
* Replace WIN32 preprocessor macros with _WIN32 * Add missing Windows.h include for InterlockedIncrement
Diffstat (limited to 'source/slang/slang-compiler.cpp')
-rw-r--r--source/slang/slang-compiler.cpp10
1 files changed, 9 insertions, 1 deletions
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 <unistd.h>
#endif
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#define NOMINMAX
+#include <Windows.h>
+#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