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

Side by Side Diff: runtime/vm/os_macos.cc

Issue 1156053006: - Determine whether the simulator is being used in globals.h (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review comments Created 5 years, 6 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 | « runtime/vm/os_linux.cc ('k') | runtime/vm/os_win.cc » ('j') | 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 "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_OS_MACOS) 6 #if defined(TARGET_OS_MACOS)
7 7
8 #include "vm/os.h" 8 #include "vm/os.h"
9 9
10 #include <errno.h> // NOLINT 10 #include <errno.h> // NOLINT
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 147 }
148 // We should only ever see an interrupt error. 148 // We should only ever see an interrupt error.
149 ASSERT(errno == EINTR); 149 ASSERT(errno == EINTR);
150 // Copy remainder into requested and repeat. 150 // Copy remainder into requested and repeat.
151 req = rem; 151 req = rem;
152 } 152 }
153 } 153 }
154 154
155 155
156 void OS::DebugBreak() { 156 void OS::DebugBreak() {
157 #if defined(HOST_ARCH_X64) || defined(HOST_ARCH_IA32) 157 __builtin_trap();
158 asm("int $3");
159 #else
160 #error Unsupported architecture.
161 #endif
162 } 158 }
163 159
164 160
165 char* OS::StrNDup(const char* s, intptr_t n) { 161 char* OS::StrNDup(const char* s, intptr_t n) {
166 // strndup has only been added to Mac OS X in 10.7. We are supplying 162 // strndup has only been added to Mac OS X in 10.7. We are supplying
167 // our own copy here if needed. 163 // our own copy here if needed.
168 #if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \ 164 #if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \
169 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1060 165 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1060
170 intptr_t len = strlen(s); 166 intptr_t len = strlen(s);
171 if ((n < 0) || (len < 0)) { 167 if ((n < 0) || (len < 0)) {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 } 264 }
269 265
270 266
271 void OS::Exit(int code) { 267 void OS::Exit(int code) {
272 exit(code); 268 exit(code);
273 } 269 }
274 270
275 } // namespace dart 271 } // namespace dart
276 272
277 #endif // defined(TARGET_OS_MACOS) 273 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « runtime/vm/os_linux.cc ('k') | runtime/vm/os_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698