ios: Handle libunwind.h header changes.

Xcode 12.5 renamed __personality_routine to _Unwind_Personality_Fn
in usr/include/unwind.h

Bug: crashpad:31
Change-Id: I06a9cec7f94556dfd7c1f729069c93c61b4b0d9c
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2686121
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
This commit is contained in:
Justin Cohen 2021-02-10 13:47:57 -05:00 committed by Commit Bot
parent 57c336371c
commit adf40ba77c

View File

@ -14,6 +14,7 @@
#include "util/ios/exception_processor.h" #include "util/ios/exception_processor.h"
#include <Availability.h>
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#include <TargetConditionals.h> #include <TargetConditionals.h>
#include <cxxabi.h> #include <cxxabi.h>
@ -174,8 +175,13 @@ id ObjcExceptionPreprocessor(id exception) {
} }
// Check to see if the handler is really an exception handler. // Check to see if the handler is really an exception handler.
__personality_routine p = #if defined(__IPHONE_14_5) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_5
reinterpret_cast<__personality_routine>(frame_info.handler); using personality_routine = _Unwind_Personality_Fn;
#else
using personality_routine = __personality_routine;
#endif
personality_routine p =
reinterpret_cast<personality_routine>(frame_info.handler);
// From 10.15.0 libunwind-35.4/src/UnwindLevel1.c. // From 10.15.0 libunwind-35.4/src/UnwindLevel1.c.
_Unwind_Reason_Code personalityResult = (*p)( _Unwind_Reason_Code personalityResult = (*p)(