Skip to content

Commit

Permalink
ocaml5: update callback3 with caml_ prefix and stub warnings and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Koon Wen Lee committed May 30, 2023
1 parent 6bc6eb9 commit bd9fb11
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -18,8 +18,8 @@ CARCHIVE=lib$(CARCHIVE_NAME).a
# Flags for the C compiler.
CFLAGS:=$(CFLAGS) -Wall $(EVENT_CFLAGS)

OCAMLC=ocamlc
OCAMLOPT=ocamlopt
OCAMLC=ocamlc -I +unix
OCAMLOPT=ocamlopt -I +unix
OCAMLDEP=ocamldep
OCAMLMKLIB=ocamlmklib
OCAMLDOC=ocamldoc
Expand Down
4 changes: 2 additions & 2 deletions event_stubs.c
Expand Up @@ -136,7 +136,7 @@ static void
event_cb(int fd, short type, void *arg)
{
caml_leave_blocking_section();
callback3(*event_cb_closure,
caml_callback3(*event_cb_closure,
Val_long((long) arg), Val_int(fd), Val_int(type));
caml_enter_blocking_section();
}
Expand Down Expand Up @@ -306,7 +306,7 @@ oc_event_base_init(value unit)
if(event_cb_closure == NULL) {
event_cb_closure = caml_named_value("event_cb");
if(event_cb_closure == NULL) {
invalid_argument("Callback event_cb not initialized.");
caml_invalid_argument("Callback event_cb not initialized.");
}
}

Expand Down
8 changes: 4 additions & 4 deletions unittest.ml
Expand Up @@ -58,7 +58,7 @@ let test_read_eof () =
Unix.shutdown s1 Unix.SHUTDOWN_SEND;

(* Setup the event *)
Global.set evt s2 [READ] false read_cb;
Global.set evt s2 [READ] ~persist:false read_cb;
add evt None;
Global.dispatch ();

Expand All @@ -71,9 +71,9 @@ let call_set () =
()
in
let e1 = create () in
Global.set e1 Unix.stderr [WRITE] false do_nothing;
Global.set e1 Unix.stdout [WRITE] false do_nothing;
Global.set e1 Unix.stdin [READ] false do_nothing;
Global.set e1 Unix.stderr [WRITE] ~persist:false do_nothing;
Global.set e1 Unix.stdout [WRITE] ~persist:false do_nothing;
Global.set e1 Unix.stdin [READ] ~persist:false do_nothing;
add e1 (Some 0.1);
Global.loop ONCE

Expand Down

0 comments on commit bd9fb11

Please sign in to comment.