Skip to content

Instantly share code, notes, and snippets.

@jnthn
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnthn/f749275e8a9485bb835a to your computer and use it in GitHub Desktop.
Save jnthn/f749275e8a9485bb835a to your computer and use it in GitHub Desktop.
diff --git a/src/core/nativecall.c b/src/core/nativecall.c
index 2131230..ec0669b 100644
--- a/src/core/nativecall.c
+++ b/src/core/nativecall.c
@@ -284,7 +284,7 @@ static void * unmarshal_carray(MVMThreadContext *tc, MVMObject *value) {
}
/* Sets up a callback, caching the information to avoid duplicate work. */
-static char callback_handler(DCCallback *cb, DCArgs *args, DCValue *result, MVMNativeCallback *data);
+static char callback_handler(DCCallback *cb, DCArgs *args, DCValue *result, void *data);
static void * unmarshal_callback(MVMThreadContext *tc, MVMObject *callback, MVMObject *sig_info) {
MVMNativeCallbackCacheHead *callback_data_head = NULL;
MVMNativeCallback **callback_data_handle;
@@ -403,7 +403,8 @@ static void callback_invoke(MVMThreadContext *tc, void *data) {
/* Ensure we exit interp after callback. */
tc->thread_entry_frame = tc->cur_frame;
}
-static char callback_handler(DCCallback *cb, DCArgs *cb_args, DCValue *cb_result, MVMNativeCallback *data) {
+static char callback_handler(DCCallback *cb, DCArgs *cb_args, DCValue *cb_result, void *v_data) {
+ MVMNativeCallback *data = (MVMNativeCallback *)v_data;
CallbackInvokeData cid;
MVMint32 num_roots, i;
MVMRegister res;
@FROGGS
Copy link

FROGGS commented Jul 4, 2014

diff --git a/src/core/nativecall.c b/src/core/nativecall.c
index 2131230..bc253d5 100644
--- a/src/core/nativecall.c
+++ b/src/core/nativecall.c
@@ -380,7 +380,7 @@ static void * unmarshal_callback(MVMThreadContext *tc, MVMObject *callback, MVMO
         callback_data->tc        = tc;
         callback_data->cs        = cs;
         callback_data->target    = callback;
-        callback_data->cb        = dcbNewCallback(signature, &callback_handler, callback_data);
+        callback_data->cb        = dcbNewCallback(signature, (DCCallbackHandler *)&callback_handler, callback_data);

         /* Now insert the MVMCallback into the linked list. */
         *callback_data_handle = callback_data;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment