| Index: runtime/bin/main.cc
|
| ===================================================================
|
| --- runtime/bin/main.cc (revision 22381)
|
| +++ runtime/bin/main.cc (working copy)
|
| @@ -262,6 +262,26 @@
|
| }
|
|
|
|
|
| +static void* OpenFile(const char* name) {
|
| + File* file = File::Open(name, File::kWriteTruncate);
|
| + ASSERT(file != NULL);
|
| + return reinterpret_cast<void*>(file);
|
| +}
|
| +
|
| +
|
| +static void WriteFile(const void* buffer, intptr_t num_bytes, void* stream) {
|
| + ASSERT(stream != NULL);
|
| + File* file_stream = reinterpret_cast<File*>(stream);
|
| + bool bytes_written = file_stream->WriteFully(buffer, num_bytes);
|
| + ASSERT(bytes_written);
|
| +}
|
| +
|
| +
|
| +static void CloseFile(void* stream) {
|
| + delete reinterpret_cast<File*>(stream);
|
| +}
|
| +
|
| +
|
| // Convert all the arguments to UTF8. On Windows, the arguments are
|
| // encoded in the current code page and not UTF8.
|
| //
|
| @@ -712,10 +732,7 @@
|
|
|
| // Initialize the Dart VM.
|
| if (!Dart_Initialize(CreateIsolateAndSetup, NULL, NULL, ShutdownIsolate,
|
| - DartUtils::OpenFile,
|
| - DartUtils::ReadFile,
|
| - DartUtils::WriteFile,
|
| - DartUtils::CloseFile)) {
|
| + OpenFile, WriteFile, CloseFile)) {
|
| fprintf(stderr, "%s", "VM initialization failed\n");
|
| fflush(stderr);
|
| return kErrorExitCode;
|
|
|