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

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

Issue 13994008: - Add OS::StrNDup instead of redefining it when needed. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/os.h ('k') | runtime/vm/os_linux.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_ANDROID) 6 #if defined(TARGET_OS_ANDROID)
7 7
8 #include "vm/os.h" 8 #include "vm/os.h"
9 9
10 #include <android/log.h> // NOLINT 10 #include <android/log.h> // NOLINT
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 // TODO(5411554): For now just use usleep we may have to revisit this. 311 // TODO(5411554): For now just use usleep we may have to revisit this.
312 usleep(millis * 1000); 312 usleep(millis * 1000);
313 } 313 }
314 314
315 315
316 void OS::DebugBreak() { 316 void OS::DebugBreak() {
317 UNIMPLEMENTED(); 317 UNIMPLEMENTED();
318 } 318 }
319 319
320 320
321 char* OS::StrNDup(const char* s, intptr_t n) {
322 return strndup(s, n);
323 }
324
325
321 void OS::Print(const char* format, ...) { 326 void OS::Print(const char* format, ...) {
322 va_list args; 327 va_list args;
323 va_start(args, format); 328 va_start(args, format);
324 VFPrint(stdout, format, args); 329 VFPrint(stdout, format, args);
325 // Forward to the Android log for remote access. 330 // Forward to the Android log for remote access.
326 __android_log_vprint(ANDROID_LOG_INFO, "DartVM", format, args); 331 __android_log_vprint(ANDROID_LOG_INFO, "DartVM", format, args);
327 va_end(args); 332 va_end(args);
328 } 333 }
329 334
330 335
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 } 421 }
417 422
418 423
419 void OS::Exit(int code) { 424 void OS::Exit(int code) {
420 exit(code); 425 exit(code);
421 } 426 }
422 427
423 } // namespace dart 428 } // namespace dart
424 429
425 #endif // defined(TARGET_OS_ANDROID) 430 #endif // defined(TARGET_OS_ANDROID)
OLDNEW
« no previous file with comments | « runtime/vm/os.h ('k') | runtime/vm/os_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698