Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1189)

Side by Side Diff: runtime/bin/utils_macos.cc

Issue 2291253002: Fix mac dartium build (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_MACOS) 6 #if defined(TARGET_OS_MACOS)
7 7
8 #include <errno.h> // NOLINT 8 #include <errno.h> // NOLINT
9 #include <mach/clock.h> // NOLINT 9 #include <mach/clock.h> // NOLINT
10 #include <mach/mach.h> // NOLINT 10 #include <mach/mach.h> // NOLINT
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 72
73 char* StringUtils::Utf8ToConsoleString( 73 char* StringUtils::Utf8ToConsoleString(
74 char* utf8, intptr_t len, intptr_t* result_len) { 74 char* utf8, intptr_t len, intptr_t* result_len) {
75 UNIMPLEMENTED(); 75 UNIMPLEMENTED();
76 return NULL; 76 return NULL;
77 } 77 }
78 78
79 79
80 char* StringUtils::StrNDup(const char* s, intptr_t n) { 80 char* StringUtils::StrNDup(const char* s, intptr_t n) {
81 // strndup has only been added to Mac OS X in 10.7. We are supplying
82 // our own copy here if needed.
83 #if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \
84 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1060
85 intptr_t len = strlen(s);
86 if ((n < 0) || (len < 0)) {
87 return NULL;
88 }
89 if (n < len) {
90 len = n;
91 }
92 char* result = reinterpret_cast<char*>(malloc(len + 1));
93 if (result == NULL) {
94 return NULL;
95 }
96 result[len] = '\0';
97 return reinterpret_cast<char*>(memmove(result, s, len));
98 #else // !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || ...
81 return strndup(s, n); 99 return strndup(s, n);
100 #endif // !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || ...
82 } 101 }
83 102
84 103
85 bool ShellUtils::GetUtf8Argv(int argc, char** argv) { 104 bool ShellUtils::GetUtf8Argv(int argc, char** argv) {
86 return false; 105 return false;
87 } 106 }
88 107
89 108
90 static mach_timebase_info_data_t timebase_info; 109 static mach_timebase_info_data_t timebase_info;
91 110
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 ASSERT(errno == EINTR); 178 ASSERT(errno == EINTR);
160 // Copy remainder into requested and repeat. 179 // Copy remainder into requested and repeat.
161 req = rem; 180 req = rem;
162 } 181 }
163 } 182 }
164 183
165 } // namespace bin 184 } // namespace bin
166 } // namespace dart 185 } // namespace dart
167 186
168 #endif // defined(TARGET_OS_MACOS) 187 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698