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 "bin/dartutils.h" | 5 #include "bin/dartutils.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "include/dart_tools_api.h" | 8 #include "include/dart_tools_api.h" |
9 #include "include/dart_native_api.h" | 9 #include "include/dart_native_api.h" |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 Dart_Handle __handle = handle; \ | 27 Dart_Handle __handle = handle; \ |
28 if (Dart_IsError((__handle))) { \ | 28 if (Dart_IsError((__handle))) { \ |
29 return __handle; \ | 29 return __handle; \ |
30 } \ | 30 } \ |
31 } | 31 } |
32 | 32 |
33 namespace dart { | 33 namespace dart { |
34 namespace bin { | 34 namespace bin { |
35 | 35 |
36 const char* DartUtils::original_working_directory = NULL; | 36 const char* DartUtils::original_working_directory = NULL; |
37 const char* DartUtils::kDartScheme = "dart:"; | 37 const char* const DartUtils::kDartScheme = "dart:"; |
38 const char* DartUtils::kDartExtensionScheme = "dart-ext:"; | 38 const char* const DartUtils::kDartExtensionScheme = "dart-ext:"; |
39 const char* DartUtils::kAsyncLibURL = "dart:async"; | 39 const char* const DartUtils::kAsyncLibURL = "dart:async"; |
40 const char* DartUtils::kBuiltinLibURL = "dart:_builtin"; | 40 const char* const DartUtils::kBuiltinLibURL = "dart:_builtin"; |
41 const char* DartUtils::kCoreLibURL = "dart:core"; | 41 const char* const DartUtils::kCoreLibURL = "dart:core"; |
42 const char* DartUtils::kInternalLibURL = "dart:_internal"; | 42 const char* const DartUtils::kInternalLibURL = "dart:_internal"; |
43 const char* DartUtils::kIsolateLibURL = "dart:isolate"; | 43 const char* const DartUtils::kIsolateLibURL = "dart:isolate"; |
44 const char* DartUtils::kIOLibURL = "dart:io"; | 44 const char* const DartUtils::kIOLibURL = "dart:io"; |
45 const char* DartUtils::kIOLibPatchURL = "dart:io-patch"; | 45 const char* const DartUtils::kIOLibPatchURL = "dart:io-patch"; |
46 const char* DartUtils::kUriLibURL = "dart:uri"; | 46 const char* const DartUtils::kUriLibURL = "dart:uri"; |
47 const char* DartUtils::kHttpScheme = "http:"; | 47 const char* const DartUtils::kHttpScheme = "http:"; |
48 const char* DartUtils::kVMServiceLibURL = "dart:vmservice"; | 48 const char* const DartUtils::kVMServiceLibURL = "dart:vmservice"; |
49 | 49 |
50 uint8_t DartUtils::magic_number[] = { 0xf5, 0xf5, 0xdc, 0xdc }; | 50 const uint8_t DartUtils::magic_number[] = { 0xf5, 0xf5, 0xdc, 0xdc }; |
51 | 51 |
52 static bool IsWindowsHost() { | 52 static bool IsWindowsHost() { |
53 #if defined(TARGET_OS_WINDOWS) | 53 #if defined(TARGET_OS_WINDOWS) |
54 return true; | 54 return true; |
55 #else // defined(TARGET_OS_WINDOWS) | 55 #else // defined(TARGET_OS_WINDOWS) |
56 return false; | 56 return false; |
57 #endif // defined(TARGET_OS_WINDOWS) | 57 #endif // defined(TARGET_OS_WINDOWS) |
58 } | 58 } |
59 | 59 |
60 | 60 |
(...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1293 new CObjectString(CObject::NewString(os_error->message())); | 1293 new CObjectString(CObject::NewString(os_error->message())); |
1294 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 1294 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
1295 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 1295 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
1296 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 1296 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
1297 result->SetAt(2, error_message); | 1297 result->SetAt(2, error_message); |
1298 return result; | 1298 return result; |
1299 } | 1299 } |
1300 | 1300 |
1301 } // namespace bin | 1301 } // namespace bin |
1302 } // namespace dart | 1302 } // namespace dart |
OLD | NEW |