Ejemplo n.º 1
0
static void cls_struct_16byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
{
  struct cls_struct_16byte b1, b2;

  b1 = *(struct cls_struct_16byte*)(args[0]);
  b2 = *(struct cls_struct_16byte*)(args[1]);

  *(cls_struct_16byte*)resp = cls_struct_16byte_fn(b1, b2);
}
Ejemplo n.º 2
0
  printf("%d %g %d %d %g %d: %d %g %d\n", b1.a, b1.b, b1.c, b2.a, b2.b, b2.c,
	 result.a, result.b, result.c);

  return result;
}

static void cls_struct_16byte_gn(ffi_cif* cif __UNUSED__, void* resp,
				 void** args, void* userdata __UNUSED__)
{
  struct cls_struct_16byte b1, b2;

  b1 = *(struct cls_struct_16byte*)(args[0]);
  b2 = *(struct cls_struct_16byte*)(args[1]);

  *(cls_struct_16byte*)resp = cls_struct_16byte_fn(b1, b2);
}

int main (void)
{
  ffi_cif cif;
#ifndef USING_MMAP
  static ffi_closure cl;
#endif
  ffi_closure *pcl;
  void* args_dbl[5];
  ffi_type* cls_struct_fields[4];
  ffi_type cls_struct_type;
  ffi_type* dbl_arg_types[5];

#ifdef USING_MMAP