samples: Fix compiler warning
Clang will warn if using #if on an undefined macro
Change-Id: I2db83ccd0304c39dd7328607f4bce6d6f80ee0d6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/37841
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/samples/main.cc b/samples/main.cc
index 862ebd9..678d3d3 100644
--- a/samples/main.cc
+++ b/samples/main.cc
@@ -85,14 +85,14 @@
Affects AST dumping, and text-based output languages.
-h -- This help text)";
-#if _MSC_VER
+#ifdef _MSC_VER
#pragma warning(disable : 4068; suppress : 4100)
#endif
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
Format parse_format(const std::string& fmt) {
#pragma clang diagnostic pop
-#if _MSC_VER
+#ifdef _MSC_VER
#pragma warning(default : 4068)
#endif
@@ -134,14 +134,14 @@
/// @param filename the filename to inspect
/// @returns the inferred format for the filename suffix
-#if _MSC_VER
+#ifdef _MSC_VER
#pragma warning(disable : 4068; suppress : 4100)
#endif
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
Format infer_format(const std::string& filename) {
#pragma clang diagnostic pop
-#if _MSC_VER
+#ifdef _MSC_VER
#pragma warning(default : 4068)
#endif