Closed bschommer closed 5 years ago
Thanks for that PR! I believe that could make it compatible with all versions of OCaml by using
Bytes.t
instead ofbytes
. On the C side, I believe thatString_val
is the same asBytes_val
. Would you care do do those changes?
If safe-string
is enabled at configure time then it is not equivalent and the most recent OCaml version is used it is not equivalent, then String_val
returns const char*
, however I think this can be probably solved by testing if CAML_SAFE_STRING
is defined.
I changed the use to Bytes_val
if the CAML_SAFE_STRING
macro is defined, which allows it to compile with earlier versions and works also with the current version. Still, since bytes
are used the version needs to be lifted to 4.02.0
Change
char *
toconst char *
for extracted String values and changed the return value of the caml_taglib_id3v2_render function to bytes instead of strings. Unfortunately this requires that the OCaml version is larger than 4.06.I think this could be avoided if the result of
ByteVector r = tag->render()
is guaranteed to be a valid C string.