From 48ac6f25ff53290850a0edff0285dc3e1a350ad3 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Fri, 13 Dec 2024 00:34:16 +0800 Subject: Correctly distinguish between windows and MSVC (#5851) Partially sorts https://github.com/shader-slang/slang/issues/5843 --- source/compiler-core/windows/slang-win-visual-studio-util.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/compiler-core') diff --git a/source/compiler-core/windows/slang-win-visual-studio-util.cpp b/source/compiler-core/windows/slang-win-visual-studio-util.cpp index e97a998d6..21830bd47 100644 --- a/source/compiler-core/windows/slang-win-visual-studio-util.cpp +++ b/source/compiler-core/windows/slang-win-visual-studio-util.cpp @@ -69,7 +69,7 @@ static SlangResult _readRegistryKey(const char* path, const char* keyName, Strin // Make easier to set up the array -static DownstreamCompilerMatchVersion _makeVersion(int main) +[[maybe_unused]] static DownstreamCompilerMatchVersion _makeVersion(int main) { DownstreamCompilerMatchVersion version; version.type = SLANG_PASS_THROUGH_VISUAL_STUDIO; @@ -77,7 +77,7 @@ static DownstreamCompilerMatchVersion _makeVersion(int main) return version; } -static DownstreamCompilerMatchVersion _makeVersion(int main, int dot) +[[maybe_unused]] static DownstreamCompilerMatchVersion _makeVersion(int main, int dot) { DownstreamCompilerMatchVersion version; version.type = SLANG_PASS_THROUGH_VISUAL_STUDIO; @@ -149,6 +149,7 @@ static SlangResult _parseVersion(UnownedStringSlice versionString, SemanticVersi /* static */ DownstreamCompilerMatchVersion WinVisualStudioUtil::getCompiledVersion() { +#ifdef _MSC_VER // Get the version of visual studio used to compile this source // Not const, because otherwise we get an warning/error about constant expression... uint32_t version = _MSC_VER; @@ -247,6 +248,7 @@ static SlangResult _parseVersion(UnownedStringSlice versionString, SemanticVersi SLANG_PASS_THROUGH_VISUAL_STUDIO, MatchSemanticVersion::makeFuture()); } +#endif // Unknown version return DownstreamCompilerMatchVersion(SLANG_PASS_THROUGH_VISUAL_STUDIO, MatchSemanticVersion()); -- cgit v1.2.3