| Index: runtime/bin/utils_macos.cc
|
| diff --git a/runtime/bin/utils_macos.cc b/runtime/bin/utils_macos.cc
|
| index eea4cb750b077503736bc228d18a32d445e5163c..136881d37f580d5af238492ecdcb9f6e891673c5 100644
|
| --- a/runtime/bin/utils_macos.cc
|
| +++ b/runtime/bin/utils_macos.cc
|
| @@ -6,22 +6,20 @@
|
| #if defined(TARGET_OS_MACOS)
|
|
|
| #include <errno.h> // NOLINT
|
| -#include <netdb.h> // NOLINT
|
| -#include <mach/mach.h> // NOLINT
|
| #include <mach/clock.h> // NOLINT
|
| +#include <mach/mach.h> // NOLINT
|
| #include <mach/mach_time.h> // NOLINT
|
| -#include <sys/time.h> // NOLINT
|
| -#include <time.h> // NOLINT
|
| -
|
| +#include <netdb.h> // NOLINT
|
| #if TARGET_OS_IOS
|
| #include <sys/sysctl.h> // NOLINT
|
| #endif
|
| +#include <sys/time.h> // NOLINT
|
| +#include <time.h> // NOLINT
|
|
|
| #include "bin/utils.h"
|
| #include "platform/assert.h"
|
| #include "platform/utils.h"
|
|
|
| -
|
| namespace dart {
|
| namespace bin {
|
|
|
| @@ -50,47 +48,55 @@ void OSError::SetCodeAndMessage(SubSystem sub_system, int code) {
|
| }
|
| }
|
|
|
| +
|
| const char* StringUtils::ConsoleStringToUtf8(
|
| const char* str, intptr_t len, intptr_t* result_len) {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
|
|
| +
|
| const char* StringUtils::Utf8ToConsoleString(
|
| const char* utf8, intptr_t len, intptr_t* result_len) {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
|
|
| +
|
| char* StringUtils::ConsoleStringToUtf8(
|
| char* str, intptr_t len, intptr_t* result_len) {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
|
|
| +
|
| char* StringUtils::Utf8ToConsoleString(
|
| char* utf8, intptr_t len, intptr_t* result_len) {
|
| UNIMPLEMENTED();
|
| return NULL;
|
| }
|
|
|
| +
|
| bool ShellUtils::GetUtf8Argv(int argc, char** argv) {
|
| return false;
|
| }
|
|
|
| +
|
| static mach_timebase_info_data_t timebase_info;
|
|
|
| +
|
| void TimerUtils::InitOnce() {
|
| kern_return_t kr = mach_timebase_info(&timebase_info);
|
| ASSERT(KERN_SUCCESS == kr);
|
| }
|
|
|
| +
|
| int64_t TimerUtils::GetCurrentMonotonicMillis() {
|
| return GetCurrentMonotonicMicros() / 1000;
|
| }
|
|
|
| -#if TARGET_OS_IOS
|
|
|
| +#if TARGET_OS_IOS
|
| static int64_t GetCurrentTimeMicros() {
|
| // gettimeofday has microsecond resolution.
|
| struct timeval tv;
|
| @@ -100,9 +106,9 @@ static int64_t GetCurrentTimeMicros() {
|
| }
|
| return (static_cast<int64_t>(tv.tv_sec) * 1000000) + tv.tv_usec;
|
| }
|
| -
|
| #endif // TARGET_OS_IOS
|
|
|
| +
|
| int64_t TimerUtils::GetCurrentMonotonicMicros() {
|
| #if TARGET_OS_IOS
|
| // On iOS mach_absolute_time stops while the device is sleeping. Instead use
|
| @@ -129,6 +135,7 @@ int64_t TimerUtils::GetCurrentMonotonicMicros() {
|
| #endif // TARGET_OS_IOS
|
| }
|
|
|
| +
|
| void TimerUtils::Sleep(int64_t millis) {
|
| struct timespec req; // requested.
|
| struct timespec rem; // remainder.
|
|
|