···37 return Val_unit; \
38 }
39#else
40+/* XXX(dinosaure): even if they are not defined (only defined by
41+ * [caml/threads.h]), they exists without [threads.cmxa]. For compatibility
42+ * reason, we keep a protection when we compile for Solo5/ocaml-freestanding
43+ * but for the rest, these functions should be available in any cases.
44+ *
45+ * In some cases (Solo5 or Esperanto), [caml/threads.h] is not available but
46+ * these functions still exist!
47+ */
48+49+extern void caml_enter_blocking_section (void);
50+extern void caml_leave_blocking_section (void);
5152#define __define_ba_update(name) \
53 CAMLprim value \
···58 uint32_t len_ = Long_val (len); \
59 struct name ## _ctx ctx_; \
60 memcpy(&ctx_, Bytes_val(ctx), sizeof(struct name ## _ctx)); \
61+ caml_enter_blocking_section(); \
62 digestif_ ## name ## _update (&ctx_, off_, len_); \
63+ caml_leave_blocking_section(); \
64 memcpy(Bytes_val(ctx), &ctx_, sizeof(struct name ## _ctx)); \
65 CAMLreturn (Val_unit); \
66 }
···74 uint32_t len_ = Long_val (len); \
75 struct sha3_ctx ctx_; \
76 memcpy(&ctx_, Bytes_val(ctx), sizeof(struct sha3_ctx)); \
77+ caml_enter_blocking_section(); \
78 digestif_sha3_update (&ctx_, off_, len_); \
79+ caml_leave_blocking_section(); \
80 memcpy(Bytes_val(ctx), &ctx_, sizeof(struct sha3_ctx)); \
81 CAMLreturn (Val_unit); \
82 }