Type_privateData(sig::Type *type) :
ffi_(NULL)
{
- if (type != NULL)
- Set(type);
+ // XXX: just in case I messed up migrating
+ _assert(type != NULL);
+ Set(type);
}
Type_privateData(sig::Type *type, ffi_type *ffi) {
ffi_type *GetFFI() {
if (ffi_ == NULL) {
- ffi_ = new(*pool_) ffi_type;
-
sig::Element element;
element.name = NULL;
element.type = type_;
ffi_cif cif;
sig::sig_ffi_cif(*pool_, &sig::ObjectiveC, &signature, &cif);
+
+ ffi_ = new(*pool_) ffi_type;
*ffi_ = *cif.rtype;
}
sig::Signature signature_;
ffi_cif cif_;
- Functor(sig::Signature &signature, void (*value)()) :
+ Functor(const sig::Signature &signature, void (*value)()) :
CYValue(reinterpret_cast<void *>(value))
{
sig::Copy(*pool_, signature_, signature);
}
static JSStaticFunction const * const StaticFunctions;
+ static JSStaticValue const * const StaticValues;
}; }
struct Closure_privateData :
JSGlobalContextRef context_;
JSObjectRef function_;
- Closure_privateData(JSContextRef context, JSObjectRef function, const char *type) :
- cy::Functor(type, NULL),
+ Closure_privateData(JSContextRef context, JSObjectRef function, const sig::Signature &signature) :
+ cy::Functor(signature, NULL),
context_(CYGetJSContext(context)),
function_(function)
{
}
};
-Closure_privateData *CYMakeFunctor_(JSContextRef context, JSObjectRef function, const char *type, void (*callback)(ffi_cif *, void *, void **, void *));
+Closure_privateData *CYMakeFunctor_(JSContextRef context, JSObjectRef function, const sig::Signature &signature, void (*callback)(ffi_cif *, void *, void **, void *));
void CYExecuteClosure(ffi_cif *cif, void *result, void **arguments, void *arg, JSValueRef (*adapter)(JSContextRef, size_t, JSValueRef[], JSObjectRef));
#endif/*CYCRIPT_INTERNAL_HPP*/