mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 22:26:06 +00:00
Defining __clang__ when MSVC was used to build zlib was added in 761c6fe8be0e (https://chromium-review.googlesource.com/c/1347773, 2018-12-12) to overcome a problem where the non-clang codepath normally used by MSVC contained SSE4.2 (x86-specific) intrinsics. Since zlib in Chromium 9d4ec9349a1b (https://chromium-review.googlesource.com/c/1960893, 2019-12-12—exactly one year later!), zlib changed and the __clang__ workaround was no longer necessary, but evidently not harmful, either. At some point, the Windows SDK improved its clang compatibility, and its headers gained some macros to disable clang warnings when being built with clang. <ucrt/corecrt.h> offers _UCRT_DISABLE_CLANG_WARNINGS, which expands to _Pragma("clang diagnostic push") and similar when clang is in use, determined by __clang__ being defined. MSVC doesn’t understand these pragmas, and raises warning C4068 (unknown pragma), which causes a build failure when warnings are treated as errors. _UCRT_DISABLE_CLANG_WARNINGS was used in many headers easily seen by zlib, such as <stdlib.h>. Because the __clang__ workaround is no longer necessary, was always wrong, and since MSVC can now build zlib for win-arm64 without it, just remove it. Bug: 42310164, 399670190 Change-Id: I9c0a811db5cf5a623f2988f13c8216e16cc56168 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/6309922 Reviewed-by: Nico Weber <thakis@chromium.org> Commit-Queue: Mark Mentovai <mark@chromium.org>