#define SHIM_DEBUG
#ifndef __EMSCRIPTEN__
-typedef void(*stub_callback_t)(const char *name, const char *fmt, void *ret_ptr, ...);
+typedef void(*stub_callback_t)(const char *name, void *ret_ptr, const char *fmt, ...);
#else /* __EMSCRIPTEN__ */
/* WASM can't handle a variadic callback, so we pass back an array of pointers instead... */
-typedef void(*stub_callback_t)(const char *name, const char *fmt, void *ret_ptr, void *args[]);
+typedef void(*stub_callback_t)(const char *name, void *ret_ptr, const char *fmt, void *args[]);
#endif /* !__EMSCRIPTEN__ */
/* this is the primary interface to shim graphics,
ret_type ret; \
debugf("SHIM GRAPHICS: " #name "\n"); \
if (!shim_graphics_callback) return; \
- shim_graphics_callback(#name, fmt, (void *)&ret, args); \
+ shim_graphics_callback(#name, (void *)&ret, fmt, args); \
return ret; \
}
void *args[] = { __VA_ARGS__ }; \
debugf("SHIM GRAPHICS: " #name "\n"); \
if (!shim_graphics_callback) return; \
- shim_graphics_callback(#name, fmt, NULL, args); \
+ shim_graphics_callback(#name, NULL, fmt, args); \
}
#else /* !__EMSCRIPTEN__ */
#define A2P
ret_type ret; \
debugf("SHIM GRAPHICS: " #name "\n"); \
if (!shim_graphics_callback) return; \
- shim_graphics_callback(#name, fmt, (void *)&ret, __VA_ARGS__); \
+ shim_graphics_callback(#name, (void *)&ret, fmt, __VA_ARGS__); \
return ret; \
}
void name args { \
debugf("SHIM GRAPHICS: " #name "\n"); \
if (!shim_graphics_callback) return; \
- shim_graphics_callback(#name, fmt, NULL, __VA_ARGS__); \
+ shim_graphics_callback(#name, NULL, fmt, __VA_ARGS__); \
}
#endif /* __EMSCRIPTEN__ */