Skip to content

Calling an Objective C IMP with floating point parameters

Nat! edited this page Mar 17, 2017 · 4 revisions

Floating point parameters are always passed via the metabi parameter block.

Convert:

   (*method)( obj, sel, (float) 0.0); return; 

to

#ifdef __MULLE_OBJC__
   mulle_objc_metaabi_param_block( struct { float  arg1; }   
                                   void *)  param;
   param.p.arg1 = 0.0;
   (*method)( *obj, sel, &param);
#else
   (*method)( *obj, sel, (float) 0.0);
#endif
}