Fixes this error:
In file included from ml_gtk.c:36:
ml_gtk.c: In function ‘ml_gtk_style_context_list_classes’:
wrappers.h:422:20: error: passing argument 2 of ‘Val_GList’ from incompatible pointer type [-Wincompatible-pointer-types]
422 | #define Val_string copy_string_check
| ^~~~~~~~~~~~~~~~~
| |
| value (*)(const char *) {aka long int (*)(const char *)}
ml_gtk.c:236:78: note: in expansion of macro ‘Val_string’
236 | { return Val_GList(gtk_style_context_list_classes(GtkStyleContext_val(ctx)), Val_string); }
| ^~~~~~~~~~
In file included from ml_gtk.c:37:
ml_glib.h:30:42: note: expected ‘value_in’ {aka ‘long int (*)(void *)’} but argument is of type ‘value (*)(const char *)’ {aka ‘long int (*)(const char *)’}
30 | CAMLexport value Val_GList (GList *list, value_in);
| ^~~~~~~~
--- lablgtk-3.1.4/src/wrappers.c.orig 2024-01-30 18:11:40.000000000 -0700
+++ lablgtk-3.1.4/src/wrappers.c 2024-02-02 10:44:31.679679889 -0700
@@ -113,7 +113,7 @@ CAMLexport value Val_pointer (void *ptr)
return ret;
}
-CAMLprim value copy_string_check (const char*str)
+CAMLprim value copy_string_check (void *str)
{
if (!str) ml_raise_null_pointer ();
return copy_string ((char*) str);
--- lablgtk-3.1.4/src/wrappers.h.orig 2024-01-30 18:11:40.000000000 -0700
+++ lablgtk-3.1.4/src/wrappers.h 2024-02-02 10:44:24.351780589 -0700
@@ -107,7 +107,7 @@ CAMLprim value ml_some (value);
value ml_cons (value, value);
CAMLexport void ml_raise_null_pointer (void) Noreturn;
CAMLexport value Val_pointer (void *);
-CAMLprim value copy_string_check (const char*);
+CAMLprim value copy_string_check (void *);
value copy_string_or_null (const char *);
value Val_option_string (const char *s);