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 "platform/globals.h" | 5 #include "platform/globals.h" |
6 #if defined(TARGET_OS_WINDOWS) | 6 #if defined(TARGET_OS_WINDOWS) |
7 | 7 |
8 #include "bin/extensions.h" | 8 #include "bin/extensions.h" |
9 #include "bin/utils.h" | 9 #include "bin/utils.h" |
10 #include "bin/utils_win.h" | 10 #include "bin/utils_win.h" |
11 #include "platform/assert.h" | 11 #include "platform/assert.h" |
12 | 12 |
13 namespace dart { | 13 namespace dart { |
14 namespace bin { | 14 namespace bin { |
15 | 15 |
16 const char* kVmSnapshotDataSymbolName = "_kDartVmSnapshotData"; | 16 const char* kVmSnapshotDataSymbolName = "_kDartVmSnapshotData"; |
17 const char* kVmSnapshotInstructionsSymbolName = "_kDartVmSnapshotInstructions"; | 17 const char* kVmSnapshotInstructionsSymbolName = "_kDartVmSnapshotInstructions"; |
18 const char* kIsolateSnapshotDataSymbolName = "_kDartIsolateSnapshotData"; | 18 const char* kIsolateSnapshotDataSymbolName = "_kDartIsolateSnapshotData"; |
19 const char* kIsolateSnapshotInstructionsSymbolName = | 19 const char* kIsolateSnapshotInstructionsSymbolName = |
20 "_kDartIsolateSnapshotInstructions"; | 20 "_kDartIsolateSnapshotInstructions"; |
21 | 21 |
22 void* Extensions::LoadLibrary(const char* library_file) { | 22 void* Extensions::LoadExtensionLibrary(const char* library_file) { |
23 SetLastError(0); | 23 SetLastError(0); |
24 | 24 |
25 // Convert to wchar_t string. | 25 // Convert to wchar_t string. |
26 int name_len = MultiByteToWideChar(CP_UTF8, 0, library_file, -1, NULL, 0); | 26 int name_len = MultiByteToWideChar(CP_UTF8, 0, library_file, -1, NULL, 0); |
27 wchar_t* name; | 27 wchar_t* name; |
28 name = new wchar_t[name_len]; | 28 name = new wchar_t[name_len]; |
29 MultiByteToWideChar(CP_UTF8, 0, library_file, -1, name, name_len); | 29 MultiByteToWideChar(CP_UTF8, 0, library_file, -1, name, name_len); |
30 | 30 |
31 void* ext = LoadLibraryW(name); | 31 void* ext = LoadLibraryW(name); |
32 delete[] name; | 32 delete[] name; |
(...skipping 20 matching lines...) Expand all Loading... |
53 OSError err; | 53 OSError err; |
54 return Dart_NewApiError(err.message()); | 54 return Dart_NewApiError(err.message()); |
55 } | 55 } |
56 return Dart_Null(); | 56 return Dart_Null(); |
57 } | 57 } |
58 | 58 |
59 } // namespace bin | 59 } // namespace bin |
60 } // namespace dart | 60 } // namespace dart |
61 | 61 |
62 #endif // defined(TARGET_OS_WINDOWS) | 62 #endif // defined(TARGET_OS_WINDOWS) |
OLD | NEW |