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

Unified Diff: runtime/include/dart_api.h

Issue 10381123: Make dart_api.h C compatible. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: prefix structs based on a suggestion from todd Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index 79ff2ee5638db08a2f84cbf00803eedcf5ed9f94..32bbd015b770e9a0ae1453342e5f07daea5638a1 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -39,6 +39,7 @@ typedef unsigned __int64 uint64_t;
#endif
#else
#include <inttypes.h>
+#include <stdbool.h>
#if __GNUC__ >= 4
#if defined(DART_SHARED_LIB)
#define DART_EXPORT DART_EXTERN_C __attribute__ ((visibility("default")))
@@ -677,7 +678,7 @@ DART_EXPORT bool Dart_Post(Dart_Port port_id, Dart_Handle object);
* the Dart heap. Only a subset of the Dart objects have a
* representation as a Dart_CObject.
*/
-struct Dart_CObject {
+typedef struct _Dart_CObject {
enum Type {
kNull = 0,
kBool,
@@ -690,8 +691,7 @@ struct Dart_CObject {
kUint8Array,
kUnsupported,
kNumberOfTypes
- };
- Type type;
+ } type;
union {
bool as_bool;
int32_t as_int32;
@@ -701,14 +701,14 @@ struct Dart_CObject {
char* as_bigint;
struct {
int length;
- Dart_CObject** values;
+ struct _Dart_CObject** values;
} as_array;
struct {
int length;
uint8_t* values;
} as_byte_array;
} value;
-};
+} Dart_CObject;
/**
* Posts a message on some port. The message will contain the
« 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