OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 #include <stdio.h> |
| 6 #include <stdlib.h> |
| 7 |
| 8 #include <dart_api.h> |
| 9 |
| 10 int main(void) { |
| 11 fprintf(stderr, "Calling Dart_SetVMFlags\n"); |
| 12 fflush(stderr); |
| 13 if (!Dart_SetVMFlags(0, NULL)) { |
| 14 fprintf(stderr, "Failed to set flags\n"); |
| 15 fflush(stderr); |
| 16 return -1; |
| 17 } |
| 18 fprintf(stderr, "Calling Dart_Initialize\n"); |
| 19 fflush(stderr); |
| 20 char* error = Dart_Initialize( |
| 21 NULL, NULL, NULL, |
| 22 NULL, NULL, NULL, NULL, |
| 23 NULL, |
| 24 NULL, |
| 25 NULL, |
| 26 NULL, |
| 27 NULL, |
| 28 NULL, |
| 29 NULL); |
| 30 if (error != NULL) { |
| 31 fprintf(stderr, "VM initialization failed: %s\n", error); |
| 32 fflush(stderr); |
| 33 free(error); |
| 34 return -1; |
| 35 } |
| 36 fprintf(stderr, "Success!\n"); |
| 37 fflush(stderr); |
| 38 return 0; |
| 39 } |
OLD | NEW |