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 <stdlib.h> | 5 #include <stdlib.h> |
6 #include <stdio.h> | 6 #include <stdio.h> |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
10 | 10 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 void FUNCTION_NAME(Logger_PrintString)(Dart_NativeArguments args) { | 110 void FUNCTION_NAME(Logger_PrintString)(Dart_NativeArguments args) { |
111 intptr_t length = 0; | 111 intptr_t length = 0; |
112 uint8_t* chars = NULL; | 112 uint8_t* chars = NULL; |
113 Dart_Handle str = Dart_GetNativeArgument(args, 0); | 113 Dart_Handle str = Dart_GetNativeArgument(args, 0); |
114 Dart_Handle result = Dart_StringToUTF8(str, &chars, &length); | 114 Dart_Handle result = Dart_StringToUTF8(str, &chars, &length); |
115 if (Dart_IsError(result)) { | 115 if (Dart_IsError(result)) { |
116 // TODO(turnidge): Consider propagating some errors here. What if | 116 // TODO(turnidge): Consider propagating some errors here. What if |
117 // an isolate gets interrupted by the embedder in the middle of | 117 // an isolate gets interrupted by the embedder in the middle of |
118 // Dart_StringToUTF8? We need to make sure not to swallow the | 118 // Dart_StringToUTF8? We need to make sure not to swallow the |
119 // interrupt. | 119 // interrupt. |
120 Platform::PrintBlocking(stdout, "%s\n", Dart_GetError(result)); | 120 printf("%s\n", Dart_GetError(result)); |
121 } else { | 121 } else { |
122 Platform::PrintBlocking(stdout, "%.*s\n", static_cast<int>(length), chars); | 122 printf("%.*s\n", static_cast<int>(length), chars); |
123 } | 123 } |
124 fflush(stdout); | |
Ivan Posva
2014/02/11 04:08:37
If you are using fflush here it would be consisten
Anders Johnsen
2014/02/14 08:43:28
Done.
| |
124 } | 125 } |
125 | 126 |
126 } // namespace bin | 127 } // namespace bin |
127 } // namespace dart | 128 } // namespace dart |
OLD | NEW |