From c26fb7b60f417e8d2bac32ba8826770a8809575d Mon Sep 17 00:00:00 2001 From: Romain Calascibetta Date: Mon, 18 Jul 2022 16:25:31 +0200 Subject: [PATCH] Use extern instead of caml/threads.h --- src-c/native/stubs.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src-c/native/stubs.c b/src-c/native/stubs.c index ef3d4c7..5914414 100644 --- a/src-c/native/stubs.c +++ b/src-c/native/stubs.c @@ -37,7 +37,17 @@ return Val_unit; \ } #else -#include +/* XXX(dinosaure): even if they are not defined (only defined by + * [caml/threads.h]), they exists without [threads.cmxa]. For compatibility + * reason, we keep a protection when we compile for Solo5/ocaml-freestanding + * but for the rest, these functions should be available in any cases. + * + * In some cases (Solo5 or Esperanto), [caml/threads.h] is not available but + * these functions still exist! + */ + +extern void caml_enter_blocking_section (void); +extern void caml_leave_blocking_section (void); #define __define_ba_update(name) \ CAMLprim value \