From cc8fe4d30bfbd184773864693d55c66bfb3d3124 Mon Sep 17 00:00:00 2001 From: Ricardo Garcia <47594367+rg3igalia@users.noreply.github.com> Date: Wed, 21 Oct 2026 13:47:12 +0200 Subject: [PATCH] Fix _WIN32 checks in io_shaderc.cc The current code uses `#if _WIN32`, which works but causes warnings when compiling with certain compilers and flags (see -Wundef for GCC and Clang). This commit replaces the checks with `#ifdef _WIN32`, which does not produce any warning. --- libshaderc_util/src/io_shaderc.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libshaderc_util/src/io_shaderc.cc b/libshaderc_util/src/io_shaderc.cc index dc2a53af9..9c32a6e18 100644 --- a/libshaderc_util/src/io_shaderc.cc +++ b/libshaderc_util/src/io_shaderc.cc @@ -16,7 +16,7 @@ #include "libshaderc_util/universal_unistd.h" -#if _WIN32 +#ifdef _WIN32 // Need _fileno from stdio.h // Need _O_BINARY and _O_TEXT from fcntl.h #include @@ -131,14 +131,14 @@ bool WriteFile(std::ostream* stream, const string_piece& output_data) { void FlushAndSetBinaryModeOnStdout() { std::fflush(stdout); -#if _WIN32 +#ifdef _WIN32 _setmode(_fileno(stdout), _O_BINARY); #endif } void FlushAndSetTextModeOnStdout() { std::fflush(stdout); -#if _WIN32 +#ifdef _WIN32 _setmode(_fileno(stdout), _O_TEXT); #endif }