Index: runtime/vm/os_macos.cc |
diff --git a/runtime/vm/os_macos.cc b/runtime/vm/os_macos.cc |
index 362ad0165764684b56b3b708d2a4dac9c60679ed..a7d3ee672364ef5fedf66fbb956ddf1a5bd1e546 100644 |
--- a/runtime/vm/os_macos.cc |
+++ b/runtime/vm/os_macos.cc |
@@ -16,7 +16,8 @@ |
#include <sys/resource.h> // NOLINT |
#include <unistd.h> // NOLINT |
#if TARGET_OS_IOS |
-#include <sys/sysctl.h> |
+#include <sys/sysctl.h> // NOLINT |
+#include <syslog.h> // NOLINT |
#endif |
#include "platform/utils.h" |
@@ -143,7 +144,7 @@ void OS::AlignedFree(void* ptr) { |
intptr_t OS::ActivationFrameAlignment() { |
#if TARGET_OS_IOS |
#if TARGET_ARCH_ARM |
- // Even if we generate code that maintains a strong alignment, we cannot |
+ // Even if we generate code that maintains a stronger alignment, we cannot |
// assert the stronger stack alignment because C++ code will not maintain it. |
return 8; |
#elif TARGET_ARCH_ARM64 |
@@ -234,10 +235,17 @@ char* OS::StrNDup(const char* s, intptr_t n) { |
void OS::Print(const char* format, ...) { |
+#if TARGET_OS_IOS |
+ va_list args; |
+ va_start(args, format); |
+ vsyslog(LOG_INFO, format, args); |
+ va_end(args); |
+#else |
va_list args; |
va_start(args, format); |
VFPrint(stdout, format, args); |
va_end(args); |
+#endif |
} |
@@ -322,10 +330,17 @@ void OS::RegisterCodeObservers() { |
void OS::PrintErr(const char* format, ...) { |
+#if TARGET_OS_IOS |
+ va_list args; |
+ va_start(args, format); |
+ vsyslog(LOG_ERR, format, args); |
+ va_end(args); |
+#else |
va_list args; |
va_start(args, format); |
VFPrint(stderr, format, args); |
va_end(args); |
+#endif |
} |