diff --git a/common b/common index 9293e5eb5..4b0f1890a 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 9293e5eb5b8f7a8c596cc6f7701c6bbc3bd86f25 +Subproject commit 4b0f1890a41444fdacc71e418e56f6d78b46aa26 diff --git a/daemon/utils.ml b/daemon/utils.ml index 3b5c957cf..a1d80bbc5 100644 --- a/daemon/utils.ml +++ b/daemon/utils.ml @@ -188,11 +188,6 @@ and compare_device_names a b = ) ) -(* Bytes.get_uint8 was added in OCaml 4.08, so when we depend on - * that version, remove this definition. - *) -external bytes_get_uint8 : bytes -> int -> int = "%bytes_safe_get" - let has_bogus_mbr device = try with_openfile device [O_RDONLY; O_CLOEXEC] 0 (fun fd -> @@ -207,7 +202,7 @@ let has_bogus_mbr device = 0x0E (* FAT16B LBA *)] in let sec0 = Bytes.create sec0size in let sec0read = read fd sec0 0 sec0size in - let sec0at = bytes_get_uint8 sec0 in + let sec0at = Bytes.get_uint8 sec0 in (* sector read completely *) sec0read = sec0size && diff --git a/docs/guestfs-building.pod b/docs/guestfs-building.pod index aef716ffc..9d97dd778 100644 --- a/docs/guestfs-building.pod +++ b/docs/guestfs-building.pod @@ -119,7 +119,7 @@ virt tools which are still written in Perl. I. Part of Perl core. -=item OCaml E 4.07 +=item OCaml E 4.08 =item OCaml findlib diff --git a/m4/guestfs-ocaml.m4 b/m4/guestfs-ocaml.m4 index bc613ac37..60233d16d 100644 --- a/m4/guestfs-ocaml.m4 +++ b/m4/guestfs-ocaml.m4 @@ -38,10 +38,10 @@ AC_ARG_ENABLE([ocaml], [], [enable_ocaml=yes]) -dnl OCaml >= 4.07 is required. -ocaml_ver_str=4.07 +dnl OCaml >= 4.08 is required. +ocaml_ver_str=4.08 ocaml_min_major=4 -ocaml_min_minor=7 +ocaml_min_minor=8 AC_MSG_CHECKING([if OCaml version >= $ocaml_ver_str]) ocaml_major="`echo $OCAMLVERSION | $AWK -F. '{print $1}'`" ocaml_minor="`echo $OCAMLVERSION | $AWK -F. '{print $2}' | sed 's/^0//'`" @@ -190,21 +190,6 @@ fi AM_CONDITIONAL([HAVE_OCAML_PKG_OUNIT], [test "x$OCAML_PKG_ounit2" != "xno" && test "x$ounit_is_v2" != "xno"]) -dnl Check if OCaml has caml_alloc_initialized_string (added 2017). -AC_MSG_CHECKING([for caml_alloc_initialized_string]) -cat >conftest.c <<'EOF' -#include -int main () { char *p = (void *) caml_alloc_initialized_string; return 0; } -EOF -AS_IF([$OCAMLC conftest.c >&AS_MESSAGE_LOG_FD 2>&1],[ - AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_CAML_ALLOC_INITIALIZED_STRING],[1], - [caml_alloc_initialized_string found at compile time.]) -],[ - AC_MSG_RESULT([no]) -]) -rm -f conftest.c conftest.o - dnl Flags we want to pass to every OCaml compiler call. OCAML_WARN_ERROR="-warn-error +C+D+E+F+L+M+P+S+U+V+Y+Z+X+52-3-6 -w -6" AC_SUBST([OCAML_WARN_ERROR]) diff --git a/ocaml/guestfs-c.h b/ocaml/guestfs-c.h index 833221aa5..44d8787da 100644 --- a/ocaml/guestfs-c.h +++ b/ocaml/guestfs-c.h @@ -24,19 +24,6 @@ #include #include -/* Replacement if caml_alloc_initialized_string is missing, added - * to OCaml runtime in 2017. - */ -#ifndef HAVE_CAML_ALLOC_INITIALIZED_STRING -static inline value -caml_alloc_initialized_string (mlsize_t len, const char *p) -{ - value sv = caml_alloc_string (len); - memcpy ((char *) String_val (sv), p, len); - return sv; -} -#endif - #define Guestfs_val(v) (*((guestfs_h **)Data_custom_val(v))) extern void guestfs_int_ocaml_raise_error (guestfs_h *g, const char *func) Noreturn;