|
30 | 30 | #include "app/src/util.h" |
31 | 31 | #include "app/src/util_ios.h" |
32 | 32 |
|
33 | | -#include <stdarg.h> |
34 | | -#include <stdio.h> |
35 | | -#include <stdlib.h> |
| 33 | +#include <cstdarg> |
| 34 | +#include <cstdio> |
| 35 | +#include <cstdlib> |
36 | 36 |
|
37 | 37 | // Workaround for Xcode 15+ / Swift 5.10+ Concurrency and C++ verbose abort |
38 | 38 | // crash on older iOS versions (iOS 15/16). |
39 | 39 | // By providing this symbol in our own binary, we prevent dyld from |
40 | 40 | // crashing when it is missing from the system libc++ on older OSs. |
41 | 41 | #if defined(_LIBCPP_VERBOSE_ABORT_NOEXCEPT) |
42 | 42 | #define FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT _LIBCPP_VERBOSE_ABORT_NOEXCEPT |
43 | | -#elif defined(__apple_build_version__) && \ |
44 | | - __apple_build_version__ >= 16000000 && __apple_build_version__ < 20000000 |
| 43 | +#elif defined(__apple_build_version__) && __apple_build_version__ >= 16000000 && \ |
| 44 | + __apple_build_version__ < 20000000 |
45 | 45 | #define FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT |
46 | 46 | #else |
47 | 47 | #define FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT noexcept |
48 | 48 | #endif |
49 | 49 |
|
| 50 | +#ifndef _LIBCPP_ABI_NAMESPACE |
| 51 | +#define _LIBCPP_ABI_NAMESPACE __1 |
| 52 | +#endif |
| 53 | + |
50 | 54 | namespace std { |
51 | | -inline namespace __1 { |
52 | | -__attribute__((weak)) void __libcpp_verbose_abort(const char* format, ...) |
53 | | - FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT { |
54 | | - va_list list; |
| 55 | +inline namespace _LIBCPP_ABI_NAMESPACE { |
| 56 | +__attribute__((weak)) void __libcpp_verbose_abort(const char* format, |
| 57 | + ...) FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT { |
| 58 | + std::va_list list; |
55 | 59 | va_start(list, format); |
56 | | - vfprintf(stderr, format, list); |
| 60 | + std::vfprintf(stderr, format, list); |
57 | 61 | va_end(list); |
58 | | - abort(); |
| 62 | + std::abort(); |
59 | 63 | } |
60 | | -} // namespace __1 |
| 64 | +} // namespace _LIBCPP_ABI_NAMESPACE |
61 | 65 | } // namespace std |
62 | 66 |
|
63 | 67 | #include "FIROptions.h" |
|
0 commit comments