From 6e343c595d52131cfc0d5126d29574ace1a9d7f0 Mon Sep 17 00:00:00 2001 From: Kate Date: Fri, 2 Jul 2021 18:13:58 +0100 Subject: [PATCH] Add partial support for OCaml 5.00 --- src/ml_glib.c | 4 ++-- src/ml_gtk.c | 2 +- src/ml_gtktree.c | 4 ++-- src/wrappers.h | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ml_glib.c b/src/ml_glib.c index 070cd66d..71d0e33f 100644 --- a/src/ml_glib.c +++ b/src/ml_glib.c @@ -105,7 +105,7 @@ CAMLprim value Val_GList (GList *list, value (*func)(gpointer)) Field(new_cell,0) = result; Field(new_cell,1) = Val_unit; if (last_cell == Val_unit) cell = new_cell; - else modify(&Field(last_cell,1), new_cell); + else caml_modify(&Field(last_cell,1), new_cell); last_cell = new_cell; list = list->next; } @@ -427,7 +427,7 @@ CAMLprim value Val_GSList (GSList *list, value (*func)(gpointer)) Field(new_cell,0) = result; Field(new_cell,1) = Val_unit; if (last_cell == Val_unit) cell = new_cell; - else modify(&Field(last_cell,1), new_cell); + else caml_modify(&Field(last_cell,1), new_cell); last_cell = new_cell; list = list->next; } diff --git a/src/ml_gtk.c b/src/ml_gtk.c index 2291f919..48037411 100644 --- a/src/ml_gtk.c +++ b/src/ml_gtk.c @@ -994,7 +994,7 @@ CAMLprim value ml_gtk_init (value argv) } argv = (argc ? alloc (argc, 0) : Atom(0)); - for (i = 0; i < argc; i++) modify(&Field(argv,i), Field(copy,i)); + for (i = 0; i < argc; i++) caml_modify(&Field(argv,i), Field(copy,i)); CAMLreturn (argv); } ML_0 (gtk_set_locale, Val_string) diff --git a/src/ml_gtktree.c b/src/ml_gtktree.c index 8a76100a..f9a99ba0 100644 --- a/src/ml_gtktree.c +++ b/src/ml_gtktree.c @@ -1487,8 +1487,8 @@ CAMLprim value ml_register_custom_model_callback_object(value custom_model, GObject *obj = GObject_val(custom_model); g_return_val_if_fail (IS_CUSTOM_MODEL (obj),Val_unit); if(Is_block(callback_object) && - (char*)callback_object < (char*)young_end && - (char*)callback_object > (char*)young_start) + (char*)callback_object < (char*)caml_young_end && + (char*)callback_object > (char*)caml_young_start) { caml_register_global_root (&callback_object); caml_minor_collection(); diff --git a/src/wrappers.h b/src/wrappers.h index bb68609e..082fd6ec 100644 --- a/src/wrappers.h +++ b/src/wrappers.h @@ -35,7 +35,7 @@ #include #include #define Is_young_block(v) \ - (Is_block(v) && (value*)(v) < young_end && (value*)(v) > young_start) + (Is_block(v) && (value*)(v) < caml_young_end && (value*)(v) > caml_young_start) #ifndef Bytes_val #define Bytes_val String_val @@ -286,7 +286,7 @@ CAMLprim value cname##_bc (value *argv, int argn) \ else if (l <= Max_young_wosize) { int i; ret = alloc_tuple(l); \ for(i=0;i