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:
authorHanno <h.baensch.92@gmail.com>2020-04-09 18:30:20 +0300
committerHanno <h.baensch.92@gmail.com>2020-04-09 18:30:20 +0300
commit4560ee24fd8fe5740f65e2d18f6ffe93d8826a90 (patch)
tree2e134c43198abb807bfcb9d876f10aa0e8e0622d /spirv_common.hpp
parent6637610b16aacfe43c77ad4060da62008a83cd12 (diff)
Improve compatibility with clang-cl
Diffstat (limited to 'spirv_common.hpp')
-rw-r--r--spirv_common.hpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/spirv_common.hpp b/spirv_common.hpp
index 24ae4e2e..671fd309 100644
--- a/spirv_common.hpp
+++ b/spirv_common.hpp
@@ -209,9 +209,12 @@ inline std::string convert_to_string(const T &t)
#define SPIRV_CROSS_FLT_FMT "%.32g"
#endif
-#ifdef _MSC_VER
-// sprintf warning.
-// We cannot rely on snprintf existing because, ..., MSVC.
+// Disable sprintf and strcat warnings.
+// We cannot rely on snprintf and family existing because, ..., MSVC.
+#if defined(__clang__) || defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#elif defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
@@ -259,7 +262,9 @@ inline std::string convert_to_string(double t, char locale_radix_point)
return buf;
}
-#ifdef _MSC_VER
+#if defined(__clang__) || defined(__GNUC__)
+#pragma GCC diagnostic pop
+#elif defined(_MSC_VER)
#pragma warning(pop)
#endif