OLD | NEW |
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_WINDOWS) | 6 #if defined(TARGET_OS_WINDOWS) |
7 | 7 |
8 #include "vm/os.h" | 8 #include "vm/os.h" |
9 | 9 |
10 #include <malloc.h> // NOLINT | 10 #include <malloc.h> // NOLINT |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 } | 179 } |
180 OS::Sleep(micros / kMicrosecondsPerMillisecond); | 180 OS::Sleep(micros / kMicrosecondsPerMillisecond); |
181 } | 181 } |
182 | 182 |
183 | 183 |
184 void OS::DebugBreak() { | 184 void OS::DebugBreak() { |
185 #if defined(_MSC_VER) | 185 #if defined(_MSC_VER) |
186 // Microsoft Visual C/C++ or drop-in replacement. | 186 // Microsoft Visual C/C++ or drop-in replacement. |
187 __debugbreak(); | 187 __debugbreak(); |
188 #elif defined(__GCC__) | 188 #elif defined(__GCC__) |
189 // MinGW? | 189 __builtin_trap(); |
190 asm("int $3"); | |
191 #else | 190 #else |
192 // Microsoft style assembly. | 191 // Microsoft style assembly. |
193 __asm { | 192 __asm { |
194 int 3 | 193 int 3 |
195 } | 194 } |
196 #endif | 195 #endif |
197 } | 196 } |
198 | 197 |
199 | 198 |
200 char* OS::StrNDup(const char* s, intptr_t n) { | 199 char* OS::StrNDup(const char* s, intptr_t n) { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 } | 328 } |
330 | 329 |
331 | 330 |
332 void OS::Exit(int code) { | 331 void OS::Exit(int code) { |
333 exit(code); | 332 exit(code); |
334 } | 333 } |
335 | 334 |
336 } // namespace dart | 335 } // namespace dart |
337 | 336 |
338 #endif // defined(TARGET_OS_WINDOWS) | 337 #endif // defined(TARGET_OS_WINDOWS) |
OLD | NEW |