Mark Mentovai 32a2c250a3 zlib: don’t define __clang__ for win-arm64 with MSVC
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>
2025-02-27 13:05:50 -08:00
..

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Name: zlib
Short Name: zlib
URL: https://zlib.net/
Revision: See zlib/README.chromium
License: zlib
License File: zlib/LICENSE
Security Critical: yes
Shipped: yes

Description:
“A massively spiffy yet delicately unobtrusive compression library.”

zlib is a free, general-purpose, legally unencumbered lossless data-compression
library. zlib implements the “deflate” compression algorithm described by RFC
1951, which combines the LZ77 (Lempel-Ziv) algorithm with Huffman coding. zlib
also implements the zlib (RFC 1950) and gzip (RFC 1952) wrapper formats.

Local Modifications:
See zlib/README.chromium.