Skip to content

Fix _WIN32 checks in io_shaderc.cc - #1612

Open
rg3igalia wants to merge 1 commit into
google:mainfrom
rg3igalia:patch-1
Open

rg3igalia wants to merge 1 commit into
google:mainfrom
rg3igalia:patch-1

Conversation

@rg3igalia

Copy link
Copy Markdown

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.

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.
@rg3igalia

Copy link
Copy Markdown
Author

Note: this fix comes from VK-GL-CTS now pulling shaderc as a dependency, resulting in the following warnings:

[548/2015] Building CXX object _deps/shaderc-build/libshaderc_util/CMakeFiles/shaderc_util.dir/src/io_shaderc.cc.o
/home/rgarcia/devel/vk-gl-cts/build/_deps/shaderc-src/libshaderc_util/src/io_shaderc.cc:19:5: warning: '_WIN32' is not defined, evaluates to 0 [-Wundef]
   19 | #if _WIN32
      |     ^
/home/rgarcia/devel/vk-gl-cts/build/_deps/shaderc-src/libshaderc_util/src/io_shaderc.cc:134:5: warning: '_WIN32' is not defined, evaluates to 0 [-Wundef]
  134 | #if _WIN32
      |     ^
/home/rgarcia/devel/vk-gl-cts/build/_deps/shaderc-src/libshaderc_util/src/io_shaderc.cc:141:5: warning: '_WIN32' is not defined, evaluates to 0 [-Wundef]
  141 | #if _WIN32
      |     ^
3 warnings generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant