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

Side by Side Diff: samples/sample_extension/sample_extension.cc

Issue 10834017: Fix the definition of kIllegalPort in dart_api.h. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use a #define to avoid undefined symbols in Dart extension shared objects. Created 8 years, 5 months 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 | « runtime/vm/dart_api_impl_test.cc ('k') | 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 #include <string.h> 4 #include <string.h>
5 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 #include "dart_api.h" 7 #include "dart_api.h"
8 8
9 Dart_NativeFunction ResolveName(Dart_Handle name, int argc); 9 Dart_NativeFunction ResolveName(Dart_Handle name, int argc);
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 Dart_CObject result; 89 Dart_CObject result;
90 result.type = Dart_CObject::kNull; 90 result.type = Dart_CObject::kNull;
91 Dart_PostCObject(reply_port_id, &result); 91 Dart_PostCObject(reply_port_id, &result);
92 } 92 }
93 93
94 void randomArrayServicePort(Dart_NativeArguments arguments) { 94 void randomArrayServicePort(Dart_NativeArguments arguments) {
95 Dart_EnterScope(); 95 Dart_EnterScope();
96 Dart_SetReturnValue(arguments, Dart_Null()); 96 Dart_SetReturnValue(arguments, Dart_Null());
97 Dart_Port service_port = 97 Dart_Port service_port =
98 Dart_NewNativePort("RandomArrayService", wrappedRandomArray, true); 98 Dart_NewNativePort("RandomArrayService", wrappedRandomArray, true);
99 if (service_port != kIllegalPort) { 99 if (service_port != ILLEGAL_PORT) {
100 Dart_Handle send_port = HandleError(Dart_NewSendPort(service_port)); 100 Dart_Handle send_port = HandleError(Dart_NewSendPort(service_port));
101 Dart_SetReturnValue(arguments, send_port); 101 Dart_SetReturnValue(arguments, send_port);
102 } 102 }
103 Dart_ExitScope(); 103 Dart_ExitScope();
104 } 104 }
105 105
106 106
107 struct FunctionLookup { 107 struct FunctionLookup {
108 const char* name; 108 const char* name;
109 Dart_NativeFunction function; 109 Dart_NativeFunction function;
(...skipping 14 matching lines...) Expand all
124 124
125 for (int i=0; function_list[i].name != NULL; ++i) { 125 for (int i=0; function_list[i].name != NULL; ++i) {
126 if (strcmp(function_list[i].name, cname) == 0) { 126 if (strcmp(function_list[i].name, cname) == 0) {
127 result = function_list[i].function; 127 result = function_list[i].function;
128 break; 128 break;
129 } 129 }
130 } 130 }
131 Dart_ExitScope(); 131 Dart_ExitScope();
132 return result; 132 return result;
133 } 133 }
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698