Include the class name in the IMPLEMENT_WRAPPERTYPEINFO macro expansion

This allow multiple uses of IMPLEMENT_WRAPPERTYPEINFO within a source file
This commit is contained in:
Jason Simmons 2016-01-07 10:49:09 -08:00
parent 3fc6351a3f
commit d5992106dd

View File

@ -66,19 +66,19 @@ class DartWrappable {
static const DartWrapperInfo& dart_wrapper_info_
#define IMPLEMENT_WRAPPERTYPEINFO(ClassName) \
static void RefObject(DartWrappable* impl) { \
static void RefObject_##ClassName(DartWrappable* impl) { \
static_cast<ClassName*>(impl)->ref(); \
} \
static void DerefObject(DartWrappable* impl) { \
static void DerefObject_##ClassName(DartWrappable* impl) { \
static_cast<ClassName*>(impl)->deref(); \
} \
static const DartWrapperInfo kDartWrapperInfo = { \
static const DartWrapperInfo kDartWrapperInfo_##ClassName = { \
#ClassName, \
sizeof(ClassName), \
&RefObject, \
&DerefObject, \
&RefObject_##ClassName, \
&DerefObject_##ClassName, \
}; \
const DartWrapperInfo& ClassName::dart_wrapper_info_ = kDartWrapperInfo; \
const DartWrapperInfo& ClassName::dart_wrapper_info_ = kDartWrapperInfo_##ClassName;
struct DartConverterWrappable {
static DartWrappable* FromDart(Dart_Handle handle);