mac: Fix build with deployment target ≥ 11

This fixes the following warning during compilation:

> process_reader_mac_test.cc:670:7: warning: address of function
> '_dyld_shared_cache_contains_path' will always evaluate to 'true'
> [-Wpointer-bool-conversion]

while still retaining compatibility with pre-macOS 11 runtimes when
built with a suitable deployment target.

Bug: 461
Change-Id: I61a360e8e02ceb7209c887819a4916a68384b89d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4873433
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Mark Mentovai 2023-09-19 16:22:22 -04:00 committed by Crashpad LUCI CQ
parent d25c332228
commit 8da335ffad

View File

@ -666,7 +666,7 @@ void VerifyImageExistenceAndTimestamp(const char* path, time_t timestamp) {
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability" #pragma clang diagnostic ignored "-Wunguarded-availability"
if (_dyld_shared_cache_contains_path && if (&_dyld_shared_cache_contains_path &&
_dyld_shared_cache_contains_path(path)) { _dyld_shared_cache_contains_path(path)) {
#pragma clang diagnostic pop #pragma clang diagnostic pop
// The timestamp will either match the timestamp of the dyld_shared_cache // The timestamp will either match the timestamp of the dyld_shared_cache