File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ CAMLC=$(CAMLRUN) $(COMPILER)
21
21
22
22
#COMPFLAGS=-strict-sequence -w +33..39 -g -warn-error A -bin-annot -nostdlib \
23
23
# -safe-string
24
- BS_COMMON_FLAGS= -bs-no-version-header -bs-no-builtin-ppx-mli -bs- diagnose -bs-no-check-div-by-zero -bs-cross-module-opt -bs-package-name bs-platform -bs-no-warn-unimplemented-external
24
+ BS_COMMON_FLAGS= -bs-no-version-header -bs-diagnose -bs-no-check-div-by-zero -bs-cross-module-opt -bs-package-name bs-platform -bs-no-warn-unimplemented-external
25
25
26
26
include ../Makefile.shared
27
27
Original file line number Diff line number Diff line change @@ -425,8 +425,14 @@ let print_string s = output_string stdout s
425
425
let print_bytes s = output_bytes stdout s
426
426
let print_int i = output_string stdout (string_of_int i)
427
427
let print_float f = output_string stdout (string_of_float f)
428
+
429
+ #if BS then
430
+ external print_endline : string -> unit = " log"
431
+ [@@ bs.val] [@@ bs.scope "console" ]
432
+ #else
428
433
let print_endline s =
429
434
output_string stdout s; output_char stdout '\n' ; flush stdout
435
+ #end
430
436
let print_newline () = output_char stdout '\n' ; flush stdout
431
437
432
438
(* Output functions on standard error *)
@@ -436,8 +442,13 @@ let prerr_string s = output_string stderr s
436
442
let prerr_bytes s = output_bytes stderr s
437
443
let prerr_int i = output_string stderr (string_of_int i)
438
444
let prerr_float f = output_string stderr (string_of_float f)
445
+ #if BS then
446
+ external prerr_endline : string -> unit = " error"
447
+ [@@ bs.val] [@@ bs.scope "console" ]
448
+ #else
439
449
let prerr_endline s =
440
450
output_string stderr s; output_char stderr '\n' ; flush stderr
451
+ #end
441
452
let prerr_newline () = output_char stderr '\n' ; flush stderr
442
453
443
454
(* Input functions on standard input *)
Original file line number Diff line number Diff line change @@ -628,7 +628,12 @@ val print_int : int -> unit
628
628
val print_float : float -> unit
629
629
(* * Print a floating-point number, in decimal, on standard output. *)
630
630
631
+ #if BS then
632
+ external print_endline : string -> unit = " log"
633
+ [@@ bs.val] [@@ bs.scope "console" ]
634
+ #else
631
635
val print_endline : string -> unit
636
+ #end
632
637
(* * Print a string, followed by a newline character, on
633
638
standard output and flush standard output. *)
634
639
@@ -656,7 +661,12 @@ val prerr_int : int -> unit
656
661
val prerr_float : float -> unit
657
662
(* * Print a floating-point number, in decimal, on standard error. *)
658
663
664
+ #if BS then
665
+ external prerr_endline : string -> unit = " error"
666
+ [@@ bs.val] [@@ bs.scope "console" ]
667
+ #else
659
668
val prerr_endline : string -> unit
669
+ #end
660
670
(* * Print a string, followed by a newline character on standard
661
671
error and flush standard error. *)
662
672
You can’t perform that action at this time.
0 commit comments