Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrédéric Wang <fwang@igalia.com>2022-06-23 12:40:02 +0300
committerFrédéric Wang <fwang@igalia.com>2022-06-23 12:40:02 +0300
commit9c44a97faa95bf1f11c31be0a4f35fc211b4707e (patch)
treebb83f75528ea60c744f8141b943f3d078020caef
parent1310f5ba4d935698d38828de8eddfd0d13bd43b7 (diff)
address more review comments
-rw-r--r--spirv_glsl.cpp4
-rw-r--r--spirv_msl.cpp8
2 files changed, 8 insertions, 4 deletions
diff --git a/spirv_glsl.cpp b/spirv_glsl.cpp
index ea36e18f..25e94700 100644
--- a/spirv_glsl.cpp
+++ b/spirv_glsl.cpp
@@ -5213,7 +5213,7 @@ string CompilerGLSL::constant_expression(const SPIRConstant &c, bool inside_bloc
}
}
-#ifdef _WIN32
+#ifdef _MSC_VER
// snprintf does not exist or is buggy on older MSVC versions, some of them
// being used by MinGW. Use sprintf instead and disable corresponding warning.
#pragma warning(push)
@@ -5408,7 +5408,7 @@ std::string CompilerGLSL::convert_double_to_string(const SPIRConstant &c, uint32
return res;
}
-#ifdef _WIN32
+#ifdef _MSC_VER
#pragma warning(pop)
#endif
diff --git a/spirv_msl.cpp b/spirv_msl.cpp
index 50d52840..7ce27018 100644
--- a/spirv_msl.cpp
+++ b/spirv_msl.cpp
@@ -16405,16 +16405,20 @@ void CompilerMSL::emit_block_hints(const SPIRBlock &)
string CompilerMSL::additional_fixed_sample_mask_str() const
{
char print_buffer[32];
-#ifdef _WIN32
+#ifdef _MSC_VER
// snprintf does not exist or is buggy on older MSVC versions, some of
// them being used by MinGW. Use sprintf instead and disable
// corresponding warning.
#pragma warning(push)
#pragma warning(disable : 4996)
+#endif
+#if _WIN32
sprintf(print_buffer, "0x%x", msl_options.additional_fixed_sample_mask);
-#pragma warning(pop)
#else
snprintf(print_buffer, sizeof(print_buffer), "0x%x", msl_options.additional_fixed_sample_mask);
#endif
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
return print_buffer;
}