mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
OCaml 4.02 introduced the 'bytes' type, a mutable string intended to replace the existing 'string' type for those cases where the byte array can be mutated. In future the 'string' type will become immutable. This is not the default now, but it can be forced using the '-safe-string' compile option. This commit changes the code so that it could be compiled using '-safe-string' (but does not actually make that change). If we detect OCaml < 4.02, we create a dummy 'Bytes' compatibility module ((nearly) an alias for the 'String' module). The only significant difference from upstream OCaml is that you must write the 'bytes' type as 'Bytes.t' in interfaces, apart from that everything else should work.