Skip to content

Commit 81c2b7b

Browse files
committed
Address code review comments on app_ios.mm
1 parent b442205 commit 81c2b7b

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

app/src/app_ios.mm

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,38 @@
3030
#include "app/src/util.h"
3131
#include "app/src/util_ios.h"
3232

33-
#include <stdarg.h>
34-
#include <stdio.h>
35-
#include <stdlib.h>
33+
#include <cstdarg>
34+
#include <cstdio>
35+
#include <cstdlib>
3636

3737
// Workaround for Xcode 15+ / Swift 5.10+ Concurrency and C++ verbose abort
3838
// crash on older iOS versions (iOS 15/16).
3939
// By providing this symbol in our own binary, we prevent dyld from
4040
// crashing when it is missing from the system libc++ on older OSs.
4141
#if defined(_LIBCPP_VERBOSE_ABORT_NOEXCEPT)
4242
#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
4545
#define FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT
4646
#else
4747
#define FIREBASE_LIBCPP_VERBOSE_ABORT_NOEXCEPT noexcept
4848
#endif
4949

50+
#ifndef _LIBCPP_ABI_NAMESPACE
51+
#define _LIBCPP_ABI_NAMESPACE __1
52+
#endif
53+
5054
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;
5559
va_start(list, format);
56-
vfprintf(stderr, format, list);
60+
std::vfprintf(stderr, format, list);
5761
va_end(list);
58-
abort();
62+
std::abort();
5963
}
60-
} // namespace __1
64+
} // namespace _LIBCPP_ABI_NAMESPACE
6165
} // namespace std
6266

6367
#include "FIROptions.h"

testing/sample_framework/src/app_framework.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
#include <cstring>
2727
#include <ctime>
2828

29-
30-
3129
namespace app_framework {
3230

3331
// Base logging methods, implemented by platform-specific files.

0 commit comments

Comments
 (0)