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>
This commit is contained in:
Ben Clayton 2021-01-14 14:29:03 +00:00 committed by Commit Bot service account
parent 2f7fea1f19
commit a7b52e33d5
1 changed files with 4 additions and 4 deletions

View File

@ -85,14 +85,14 @@ const char kUsage[] = R"(Usage: tint [options] <input-file>
Affects AST dumping, and text-based output languages. Affects AST dumping, and text-based output languages.
-h -- This help text)"; -h -- This help text)";
#if _MSC_VER #ifdef _MSC_VER
#pragma warning(disable : 4068; suppress : 4100) #pragma warning(disable : 4068; suppress : 4100)
#endif #endif
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter" #pragma clang diagnostic ignored "-Wunused-parameter"
Format parse_format(const std::string& fmt) { Format parse_format(const std::string& fmt) {
#pragma clang diagnostic pop #pragma clang diagnostic pop
#if _MSC_VER #ifdef _MSC_VER
#pragma warning(default : 4068) #pragma warning(default : 4068)
#endif #endif
@ -134,14 +134,14 @@ bool ends_with(const std::string& input, const std::string& suffix) {
/// @param filename the filename to inspect /// @param filename the filename to inspect
/// @returns the inferred format for the filename suffix /// @returns the inferred format for the filename suffix
#if _MSC_VER #ifdef _MSC_VER
#pragma warning(disable : 4068; suppress : 4100) #pragma warning(disable : 4068; suppress : 4100)
#endif #endif
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter" #pragma clang diagnostic ignored "-Wunused-parameter"
Format infer_format(const std::string& filename) { Format infer_format(const std::string& filename) {
#pragma clang diagnostic pop #pragma clang diagnostic pop
#if _MSC_VER #ifdef _MSC_VER
#pragma warning(default : 4068) #pragma warning(default : 4068)
#endif #endif