garrigue / lablgtk

LablGTK 2 and 3: an interface to the GIMP Tool Kit
https://garrigue.github.io/lablgtk
Other
90 stars 40 forks source link

Remove naked pointers and Obj.truncate for compatibility with 5.00 #144

Closed garrigue closed 2 years ago

garrigue commented 2 years ago

The lookup_info structures generated by varcc were returned as raw pointers to ocaml, which caused failures in multicore. This fixes that by wrapping them, and returning them inside an allocated tuple.

garrigue commented 2 years ago

This version at least compiles with trunk and multicore, but it may fail at runtime on multicore.

olafhering commented 2 years ago

caml_sys_modify_argv was introduced in ocaml/ocaml@18edce3b5f752a1d952371a3d263c461debb8d8b, which causes coq/coq@2e100906d5d0c276335665ffefedb906d21165ca FTBFS with older OCaml.

garrigue commented 2 years ago

caml_sys_modify_argv was introduced in ocaml/ocaml@18edce3, which causes coq/coq@2e10090 FTBFS with older OCaml.

It is available since caml 4.09. Do you need to support ocaml versions older than that? Note that for lablgtk2, I did a slightly more involved fix, which checks the version number, and calls Obj.truncate from the C side for older versions (between 4.06 and 4.08, for other reasons). Is it worth porting the fix to lablgtk3?

olafhering commented 2 years ago

Personally I'm fine with adding a constraint on the OCaml version.