Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(879)

Side by Side Diff: runtime/bin/test_extension.c

Issue 108493003: Fix build break (true is not defined on windows for C). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <assert.h> 5 #include <assert.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "include/dart_api.h" 10 #include "include/dart_api.h"
(...skipping 24 matching lines...) Expand all
35 Dart_NativeFunction ResolveName(Dart_Handle name, 35 Dart_NativeFunction ResolveName(Dart_Handle name,
36 int argc, 36 int argc,
37 bool* auto_setup_scope) { 37 bool* auto_setup_scope) {
38 /* assert(Dart_IsString(name)); */ 38 /* assert(Dart_IsString(name)); */
39 const char* c_name; 39 const char* c_name;
40 Dart_Handle check_error; 40 Dart_Handle check_error;
41 41
42 if (auto_setup_scope == NULL) { 42 if (auto_setup_scope == NULL) {
43 return NULL; 43 return NULL;
44 } 44 }
45 *auto_setup_scope = true; 45 *auto_setup_scope = 1;
46 check_error = Dart_StringToCString(name, &c_name); 46 check_error = Dart_StringToCString(name, &c_name);
47 if (Dart_IsError(check_error)) { 47 if (Dart_IsError(check_error)) {
48 Dart_PropagateError(check_error); 48 Dart_PropagateError(check_error);
49 } 49 }
50 if ((strcmp("TestExtension_IfNull", c_name) == 0) && (argc == 2)) { 50 if ((strcmp("TestExtension_IfNull", c_name) == 0) && (argc == 2)) {
51 return IfNull; 51 return IfNull;
52 } 52 }
53 if ((strcmp("TestExtension_ThrowMeTheBall", c_name) == 0) && (argc == 1)) { 53 if ((strcmp("TestExtension_ThrowMeTheBall", c_name) == 0) && (argc == 1)) {
54 return ThrowMeTheBall; 54 return ThrowMeTheBall;
55 } 55 }
56 return NULL; 56 return NULL;
57 } 57 }
58 58
59 59
60 /* Native entry point for the extension library. */ 60 /* Native entry point for the extension library. */
61 DART_EXPORT Dart_Handle test_extension_Init(Dart_Handle parent_library) { 61 DART_EXPORT Dart_Handle test_extension_Init(Dart_Handle parent_library) {
62 Dart_Handle result_code; 62 Dart_Handle result_code;
63 if (Dart_IsError(parent_library)) { 63 if (Dart_IsError(parent_library)) {
64 return parent_library; 64 return parent_library;
65 } 65 }
66 66
67 result_code = Dart_SetNativeResolver(parent_library, ResolveName); 67 result_code = Dart_SetNativeResolver(parent_library, ResolveName);
68 if (Dart_IsError(result_code)) { 68 if (Dart_IsError(result_code)) {
69 return result_code; 69 return result_code;
70 } 70 }
71 71
72 return parent_library; 72 return parent_library;
73 } 73 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698