Imported Upstream snapshot 3.12.0~0dev23+10396
authorStephane Glondu <steph@glondu.net>
Sun, 18 Apr 2010 12:08:52 +0000 (14:08 +0200)
committerStephane Glondu <steph@glondu.net>
Sat, 15 May 2010 17:21:43 +0000 (19:21 +0200)
179 files changed:
.depend
Changes
Makefile.nt
README.win32
VERSION
_tags
asmcomp/alpha/selection.ml
asmcomp/arm/emit.mlp
asmcomp/arm/selection.ml
asmcomp/hppa/selection.ml
asmcomp/ia64/selection.ml
asmcomp/power/selection.ml
asmcomp/sparc/selection.ml
asmrun/.cvsignore
asmrun/.depend
asmrun/Makefile
asmrun/Makefile.nt
asmrun/amd64.S
asmrun/roots.c
asmrun/stack.h
asmrun/startup.c
boot/ocamlc
boot/ocamldep
boot/ocamllex
build/boot-c-parts-windows.sh [deleted file]
build/boot-c-parts.sh
build/fastworld.sh
build/install.sh
build/mkconfig.sh
build/new-build-system
build/otherlibs-targets.sh
build/world.sh
byterun/.depend
byterun/debugger.c
byterun/debugger.h
byterun/finalise.c
byterun/gc_ctrl.c
byterun/io.c
byterun/stacks.c
byterun/stacks.h
camlp4/.vcs [deleted file]
camlp4/Camlp4/Camlp4Ast.partial.ml
camlp4/Camlp4/Printers/OCaml.ml
camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml
camlp4/Camlp4Parsers/Camlp4OCamlParser.ml
camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml
camlp4/Makefile [deleted file]
camlp4/Makefile.ml [deleted file]
camlp4/boot/Camlp4.ml
camlp4/boot/Camlp4Ast.ml
camlp4/boot/camlp4boot.ml
config/Makefile.msvc64
configure
debugger/command_line.ml
debugger/debugcom.ml
debugger/debugcom.mli
driver/main.ml
driver/main_args.ml
driver/main_args.mli
driver/optmain.ml
emacs/caml-help.el
emacs/camldebug.el
emacs/inf-caml.el
lex/parser.mly
myocamlbuild.ml
ocamlbuild/Makefile
ocamlbuild/_tags
ocamldoc/.depend
ocamldoc/odoc_analyse.ml
ocamldoc/odoc_ast.ml
ocamldoc/odoc_cross.ml
ocamldoc/odoc_html.ml
ocamldoc/odoc_info.mli
ocamldoc/odoc_latex.ml
ocamldoc/odoc_module.ml
ocamldoc/odoc_sig.ml
ocamldoc/odoc_to_text.ml
otherlibs/bigarray/.depend
otherlibs/bigarray/dllbigarray.dlib [deleted file]
otherlibs/graph/.depend
otherlibs/num/.depend
otherlibs/num/Makefile.nt
otherlibs/num/big_int.ml
otherlibs/num/big_int.mli
otherlibs/num/bng_digit.c
otherlibs/num/dllnums.dlib [deleted file]
otherlibs/str/.depend
otherlibs/str/dllstr.dlib [deleted file]
otherlibs/str/str.ml
otherlibs/systhreads/.depend
otherlibs/systhreads/Makefile
otherlibs/systhreads/Makefile.nt
otherlibs/systhreads/dllthreads.dlib [deleted file]
otherlibs/systhreads/libthreads.clib
otherlibs/systhreads/libthreadswin32.clib [deleted file]
otherlibs/systhreads/posix.c [deleted file]
otherlibs/systhreads/st_posix.h [new file with mode: 0644]
otherlibs/systhreads/st_stubs.c [new file with mode: 0644]
otherlibs/systhreads/st_win32.h [new file with mode: 0644]
otherlibs/systhreads/thread.ml [new file with mode: 0644]
otherlibs/systhreads/thread_posix.ml [deleted file]
otherlibs/systhreads/thread_win32.ml [deleted file]
otherlibs/systhreads/threads.h [new file with mode: 0644]
otherlibs/systhreads/win32.c [deleted file]
otherlibs/threads/.depend
otherlibs/unix/.depend
otherlibs/unix/fork.c
otherlibs/win32graph/dllgraphics.dlib [deleted file]
otherlibs/win32unix/dllunix.dlib [deleted file]
parsing/parser.mly
stdlib/.depend
stdlib/Makefile.shared
stdlib/format.ml
stdlib/format.mli
stdlib/gc.ml
stdlib/gc.mli
stdlib/lazy.mli
stdlib/printexc.ml
stdlib/printexc.mli
stdlib/scanf.ml
stdlib/scanf.mli
testsuite/Makefile
testsuite/interactive/lib-graph-2/Makefile
testsuite/interactive/lib-graph-3/Makefile
testsuite/interactive/lib-graph/Makefile
testsuite/makefiles/Makefile.common
testsuite/makefiles/Makefile.one
testsuite/makefiles/Makefile.several
testsuite/tests/asmcomp/Makefile
testsuite/tests/asmcomp/amd64.S
testsuite/tests/basic-io-2/Makefile
testsuite/tests/basic-io/Makefile
testsuite/tests/basic-manyargs/Makefile
testsuite/tests/basic/equality.ml
testsuite/tests/basic/equality.reference
testsuite/tests/basic/patmatch.ml
testsuite/tests/basic/patmatch.reference
testsuite/tests/gc-roots/Makefile
testsuite/tests/lib-digest/Makefile
testsuite/tests/lib-dynlink-bytecode/Makefile
testsuite/tests/lib-marshal/Makefile
testsuite/tests/lib-num/end_test.reference
testsuite/tests/lib-num/test_big_ints.ml
testsuite/tests/lib-scanf/Makefile
testsuite/tests/lib-scanf/tscanf.ml
testsuite/tests/runtime-errors/Makefile
testsuite/tests/tool-ocamldoc/Makefile
testsuite/tests/tool-ocamldoc/t02.ml [new file with mode: 0644]
testsuite/tests/tool-ocamldoc/t02.reference [new file with mode: 0644]
testsuite/tests/tool-ocamldoc/t03.ml [new file with mode: 0644]
testsuite/tests/tool-ocamldoc/t03.reference [new file with mode: 0644]
testsuite/tests/typing-fstclassmod/Makefile
testsuite/tests/typing-objects/Exemples.ml.reference
testsuite/tests/typing-objects/Tests.ml.reference
testsuite/tests/typing-poly/poly.ml.principal.reference
testsuite/tests/typing-poly/poly.ml.reference
testsuite/tests/typing-private-bugs/Makefile [new file with mode: 0644]
testsuite/tests/typing-private-bugs/pr5026_bad.ml [new file with mode: 0644]
testsuite/tests/typing-typeparam/Makefile
tools/Makefile.shared
tools/ocamlcp.ml
toplevel/opttopmain.ml
toplevel/toplevellib.mllib
toplevel/topmain.ml
typing/ctype.ml
typing/env.ml
typing/predef.ml
typing/printtyp.ml
typing/subst.ml
typing/typeclass.ml
typing/typecore.ml
typing/typecore.mli
typing/typedecl.ml
typing/typemod.ml
utils/ccomp.ml
utils/tbl.ml
utils/tbl.mli
utils/warnings.ml
utils/warnings.mli

diff --git a/.depend b/.depend
index daf84360da12f3aa47c6d258bf9cc32c14d979bd..316b34e93f7db72e23187dc23eec4fc40ceddb52 100644 (file)
--- a/.depend
+++ b/.depend
@@ -227,14 +227,14 @@ typing/typecore.cmx: utils/warnings.cmx typing/typetexp.cmx typing/types.cmx \
     parsing/longident.cmx parsing/location.cmx typing/ident.cmx \
     typing/env.cmx typing/ctype.cmx utils/clflags.cmx typing/btype.cmx \
     parsing/asttypes.cmi typing/annot.cmi typing/typecore.cmi
-typing/typedecl.cmo: typing/typetexp.cmi typing/types.cmi \
+typing/typedecl.cmo: utils/warnings.cmi typing/typetexp.cmi typing/types.cmi \
     typing/typedtree.cmi typing/subst.cmi typing/printtyp.cmi \
     typing/primitive.cmi typing/predef.cmi typing/path.cmi \
     parsing/parsetree.cmi utils/misc.cmi parsing/longident.cmi \
     parsing/location.cmi typing/includecore.cmi typing/ident.cmi \
     typing/env.cmi typing/ctype.cmi utils/config.cmi utils/clflags.cmi \
     typing/btype.cmi parsing/asttypes.cmi typing/typedecl.cmi
-typing/typedecl.cmx: typing/typetexp.cmx typing/types.cmx \
+typing/typedecl.cmx: utils/warnings.cmx typing/typetexp.cmx typing/types.cmx \
     typing/typedtree.cmx typing/subst.cmx typing/printtyp.cmx \
     typing/primitive.cmx typing/predef.cmx typing/path.cmx \
     parsing/parsetree.cmi utils/misc.cmx parsing/longident.cmx \
@@ -735,8 +735,8 @@ driver/main.cmx: utils/warnings.cmx utils/misc.cmx driver/main_args.cmx \
     driver/errors.cmx utils/config.cmx driver/compile.cmx utils/clflags.cmx \
     bytecomp/bytepackager.cmx bytecomp/bytelink.cmx \
     bytecomp/bytelibrarian.cmx driver/main.cmi
-driver/main_args.cmo: driver/main_args.cmi
-driver/main_args.cmx: driver/main_args.cmi
+driver/main_args.cmo: utils/warnings.cmi driver/main_args.cmi
+driver/main_args.cmx: utils/warnings.cmx driver/main_args.cmi
 driver/optcompile.cmo: utils/warnings.cmi typing/unused_var.cmi \
     typing/typemod.cmi typing/typedtree.cmi bytecomp/translmod.cmi \
     typing/stypes.cmi bytecomp/simplif.cmi typing/printtyp.cmi \
diff --git a/Changes b/Changes
index 76381b29f9a6c8a9bde02bea7781c3dbecd5af1b..f7e2be0e13cfe6422dfdd64e15a29fd04affea5e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -30,11 +30,37 @@ Language features:
   "S with type t1 = ... and ... and type tn = ..." (S refers to a module type).
 - Local opening of modules in a subexpression.
   Syntax: "let open M in e", or "M.(e)"
+- In class definitions, method and instance variable override can now
+  be made explicit, by writing "method!", "val!" or "inherit!" in place of
+  "method", "val" and "inherit". It is an error to override an
+  undefined member (or to use overriding inheritance when nothing get
+  overriden). Additionally, these constructs disactivate respectively
+  warnings 7 (method override, code 'M') and 13 (instance variable
+  override, code 'V'). Note that, by default, warning 7 is inactive
+  and warning 13 is active.
+- "Destructive" substitution in signatures.
+  By writing "<signature> with type t := <typeconstr>" and
+  "<signature> with module M := <module-path>" one replaces "t" and "M"
+  inside the signature, removing their respective fields. Among other
+  uses, this allows to merge two signatures containing identically
+  named fields.
+
 
 Compilers and toplevel:
-- New warning (activated by the warning code 'R') to signal
-  record patterns without "; _" where some labels of the record type
-  are not listed in the pattern.
+- Warnings are now numbered and can be switched on and off individually.
+  The old system with letters referring to sets of warnings is still
+  supported.
+- New warnings:
+  + 9 (code 'R') to signal record patterns without "; _" where
+    some labels of the record type are not listed in the pattern.
+  + 28 when giving a wildcard argument to a constant constructor in
+    a pattern-matching.
+  + 29 when an end-of-line appears unescaped in a string constant.
+  + 30 when the same constructor or record field is defined twice in
+    mutually-recursive type definitions.
+* The semantics of warning 7 (code 'M', method override) have changed
+  (it now detects all overrides, not just repeated definitions inside
+  the same class body), and it is now inactive by default.
 - Better error report in case of unbound qualified identifier: if the module
   is unbound this error is reported in the first place.
 - Added option '-strict-sequence' to force left hand part of sequence to have
@@ -50,17 +76,23 @@ Standard library:
   functions (int_of_string, Int32.of_string, Int64.of_string,
   Nativeint.of_string).  The decimal string corresponding to
   max_int + 1 is no longer accepted.
-- Format: to prevent confusion when mixing Format printing functions and
-  direct low level output, values Format.stdout and Format.stderr have been
-  added.
 - Scanf: to prevent confusion when mixing Scanf scanning functions and direct
   low level input, value Scanf.stdin has been added.
+* Random: changed the algorithm to produce better randomness.  Now passes the
+  DieHard tests.
+
+Ocamlbuild:
+- Add support for native dynlink.
 
 Bug Fixes:
 - PR#4775: compiler crash on crazy types (temporary fix)
+- PR#4970: better error message for instance variables
+- PR#4988: contravariance lost with ocamlc -i
 - PR#5004: problem in Buffer.add_channel with very large lengths.
 - PR#5008: on AMD64/MSVC port, rare float corruption during GC.
 - PR#5018: wrong exception raised by Dynlink.loadfile.
+- Wrong type for Obj.add_offset.
+- Small problem with the representation of Int32, Int64, and Nativeint constants.
 
 Objective Caml 3.11.2:
 ----------------------
index 62de9eeaaed98b7fe10423c86f300f357faac21e..22028e6466c31326e422239f791e0f71cd68ce40 100644 (file)
@@ -84,10 +84,10 @@ DRIVER=driver/pparse.cmo driver/errors.cmo driver/compile.cmo \
   driver/main_args.cmo driver/main.cmo
 
 OPTDRIVER=driver/pparse.cmo driver/opterrors.cmo driver/optcompile.cmo \
-  driver/optmain.cmo
+  driver/main_args.cmo driver/optmain.cmo
 
 TOPLEVEL=driver/pparse.cmo driver/errors.cmo driver/compile.cmo \
-  toplevel/genprintval.cmo toplevel/toploop.cmo \
+  driver/main_args.cmo toplevel/genprintval.cmo toplevel/toploop.cmo \
   toplevel/trace.cmo toplevel/topdirs.cmo toplevel/topmain.cmo
 
 TOPLEVELLIB=toplevel/toplevellib.cma
@@ -101,6 +101,7 @@ TOPOBJS=$(TOPLEVELLIB) $(TOPLEVELSTART)
 
 NATTOPOBJS=$(OPTUTILS) $(PARSING) $(TYPING) $(COMP) $(ASMCOMP) \
   driver/pparse.cmo driver/opterrors.cmo driver/optcompile.cmo \
+  driver/main_args.cmo \
   toplevel/genprintval.cmo toplevel/opttoploop.cmo toplevel/opttopdirs.cmo \
   toplevel/opttopmain.cmo toplevel/opttopstart.cmo
 
index 9479e1137786c79a57c9798fc3c596913dcdfccc..46fec15790d108d473944312d9bef34e551b8a50 100644 (file)
@@ -61,6 +61,9 @@ Microsoft Visual C++ compiler (items [1] and [2] in the section
 The native-code compiler (ocamlopt) requires Visual C++ (items [1], [2]),
 the Microsoft assembler MASM (item [3]) and the flexdll tool (item [5]).
 
+Instead of items [1], [2] and [3], it is possible to use item [6] which contains
+everything needed.
+
 The LablTk GUI requires Tcl/Tk 8.5 (item [4]).
 
 
@@ -103,6 +106,9 @@ http://www.microsoft.com/downloads/details.aspx?FamilyID=7A1C9DA0-0510-44A2-B042
 [5] flexdll.
     Can be downloaded from http://alain.frisch.fr/flexdll.html
 
+[6] Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 Service Pack 1
+
+
 RECOMPILATION FROM THE SOURCES:
 
 The command-line tools can be recompiled from the Unix source
@@ -322,6 +328,10 @@ THIRD-PARTY SOFTWARE:
     Includes all we need, namely a C compiler, the masm64 assembler,
     Windows libraries and include files.
 
+    Alternatively, the more recent SDK:
+      Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 Service Pack 1
+    can be used.
+
 [2] flexdll.
     Can be downloaded from http://alain.frisch.fr/flexdll.html
 
diff --git a/VERSION b/VERSION
index 9d186bd04cf715b9d5bbf06a813ab7f7ada99d44..58fc0bdc1d82b3ef0a69dc8202cc805c94026b93 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,4 +1,4 @@
-3.12.0+dev17 (2010-01-20)
+3.12.0+dev23 (2010-05-12)
 
 # The version string is the first line of this file.
 # It must be in the format described in stdlib/sys.mli
diff --git a/_tags b/_tags
index 8e702f5cb644c892df40c60be1943bda05b7cb29..a3b545706c34c60ce73ce38b1756268636c1e0e5 100644 (file)
--- a/_tags
+++ b/_tags
@@ -19,7 +19,7 @@ true: use_stdlib
 # The stdlib neither requires the stdlib nor debug information
 <stdlib/**>: -use_stdlib, -debug
 
-<**/*.ml*>: warn_Alerz
+<**/*.ml*>: warn_error_A
 
 "toplevel/topstart.byte": linkall
 
@@ -28,18 +28,18 @@ true: use_stdlib
 <ocamldoc/*.ml*>: include_unix, include_str, include_dynlink
 <ocamldoc/odoc.{byte,native}>: use_unix, use_str, use_dynlink
 
-<camlp4/**/*.ml*>: camlp4boot, -warn_Alerz, warn_Aler
+<camlp4/**/*.ml*>: camlp4boot, warn_Z
 <camlp4/Camlp4_{config,import}.ml*>: -camlp4boot
-"camlp4/Camlp4_import.ml": -warn_Aler
-<camlp4/build/*> or <camlp4/boot/*> or "camlp4/Camlp4/Struct/Lexer.ml": -camlp4boot, -warn_Aler, warn_a
+"camlp4/Camlp4_import.ml": -warn_Z
+<camlp4/build/*> or <camlp4/boot/*> or "camlp4/Camlp4/Struct/Lexer.ml": -camlp4boot, -warn_Z, warn_a
 <camlp4/Camlp4Bin.{byte,native}> or <camlp4/{mkcamlp4,boot/camlp4boot}.byte>: use_dynlink
-"camlp4/Camlp4/Printers/OCaml.ml" or "camlp4/Camlp4/Printers/OCamlr.ml": warn_Alerzv
+"camlp4/Camlp4/Printers/OCaml.ml" or "camlp4/Camlp4/Printers/OCamlr.ml": -warn_Z, warn_v
 <camlp4/Camlp4Printers/**.ml>: include_unix
 "camlp4/Camlp4/Struct/DynLoader.ml" or "camlp4/boot/Camlp4.ml": include_dynlink
 <camlp4/Camlp4Top/**>: include_toplevel
 <camlp4/camlp4{,boot,o,r,of,rf,oof,orf}.byte>: -debug
 
-<ocamlbuild/*>: -warn_Alerz, include_unix
+<ocamlbuild/*>: include_unix
 
 <**/pervasives.ml> or <**/pervasives.mli> or <**/camlinternalOO.mli>: nopervasives
 <**/camlinternalOO*.cmx>: inline(0)
@@ -83,4 +83,3 @@ true: use_stdlib
 "otherlibs/labltk/browser/jglib.cma": -ocamlmklib
 "otherlibs/labltk/browser/main.byte": use_unix, use_str, ocamlbrowser, bootstrap_thread
 <otherlibs/labltk/{browser,jpf}/**.ml*>: include_unix, include_str
-<otherlibs/labltk/{tkanim,frx}/**.ml*>: include_unix
index 6bea0f192f19cb2ab90d5b58e344253ca0e050d2..d91ec5bdf86a05649a529de89417ffcd1e27f748 100644 (file)
@@ -40,7 +40,7 @@ method select_addressing = function
   | arg ->
       (Iindexed 0, arg)
 
-method select_operation op args =
+method! select_operation op args =
   match (op, args) with
     (* Recognize shift-add operations *)
     ((Caddi|Cadda),
index 307d097dc443fdebb859858403f04c5327a5aa12..cfcb0c94fbdc2faa465929e92f8094cd39c034f3 100644 (file)
@@ -573,7 +573,7 @@ let emit_item = function
   | Cdefine_symbol s ->
       `{emit_symbol s}:\n`
   | Cdefine_label lbl ->
-      `{emit_label (10000 + lbl)}:\n`
+      `{emit_label (100000 + lbl)}:\n`
   | Cint8 n ->
       `        .byte   {emit_int n}\n`
   | Cint16 n ->
@@ -583,17 +583,13 @@ let emit_item = function
   | Cint n ->
       `        .word   {emit_nativeint n}\n`
   | Csingle f ->
-      `        .float  {emit_string    f}\n`
+      emit_float32_directive ".long" f
   | Cdouble f ->
-      (* FIXME: this version of the ARM port is mixed-endian, so we
-         use .double instead of emit_float64_directive.  The next
-         version is little-endian, so we'll use emit_float64 then. *)
-      `        .align  0\n`;
-      `        .double {emit_string f}\n`
+      emit_float64_split_directive ".long" f
   | Csymbol_address s ->
       `        .word   {emit_symbol s}\n`
   | Clabel_address lbl ->
-      `        .word   {emit_label (10000 + lbl)}\n`
+      `        .word   {emit_label (100000 + lbl)}\n`
   | Cstring s ->
       emit_string_directive "  .ascii  " s
   | Cskip n ->
index ded233edadc088d4cf25903fc935d9cbdd43ab85..1574bf01e7b6f77d2be5051c91bc7f8c78bf62be 100644 (file)
@@ -55,7 +55,7 @@ class selector = object(self)
 
 inherit Selectgen.selector_generic as super
 
-method regs_for tyv =
+method! regs_for tyv =
   (* Expand floats into pairs of integer registers *)
   let nty = Array.length tyv in
   let rec expand i =
@@ -94,7 +94,7 @@ method select_shift_arith op shiftop shiftrevop args =
   | _ ->
       super#select_operation op args
 
-method select_operation op args =
+method! select_operation op args =
   match op with
     Cadda | Caddi ->
       begin match args with
@@ -150,12 +150,12 @@ method select_operation op args =
             args)])
   (* Add coercions around loads and stores of 32-bit floats *)
   | Cload Single ->
-      (Iextcall("__extendsdfd2", false), [Cop(Cload Word, args)])
+      (Iextcall("__extendsfdf2", false), [Cop(Cload Word, args)])
   | Cstore Single ->
       begin match args with
       | [arg1; arg2] ->
           let arg2' =
-            Cop(Cextcall("__truncdfsd2", typ_int, false, Debuginfo.none),
+            Cop(Cextcall("__truncdfsf2", typ_int, false, Debuginfo.none),
                 [arg2]) in
           self#select_operation (Cstore Word) [arg1; arg2']
       | _ -> assert false
@@ -163,7 +163,7 @@ method select_operation op args =
   (* Other operations are regular *)
   | _ -> super#select_operation op args
 
-method select_condition = function
+method! select_condition = function
   | Cop(Ccmpf cmp, args) ->
       (Iinttest_imm(Isigned cmp, 0),
        Cop(Cextcall(float_comparison_function cmp,
@@ -182,7 +182,7 @@ method select_condition = function
    this simplifies code generation later.
 *)
 
-method insert_op_debug op dbg rs rd =
+method! insert_op_debug op dbg rs rd =
   match op with
   | Iintop(Imul) ->
       self#insert_debug (Iop op) dbg rs [| rd.(0); rs.(0) |]; rd
index a13b5271145a82df7c3a6c609628ccaaf99674b8..74c546b08b5ed557106503843c4a144722f3a542 100644 (file)
@@ -45,7 +45,7 @@ method select_addressing = function
   | arg ->
       (Iindexed 0, arg)
 
-method select_operation op args =
+method! select_operation op args =
   match (op, args) with
   (* Recognize shift-add operations. *)
     ((Caddi|Cadda),
@@ -92,7 +92,7 @@ method select_operation op args =
 
 (* Deal with register constraints *)
 
-method insert_op_debug op dbg rs rd =
+method! insert_op_debug op dbg rs rd =
   match op with
     Iintop(Idiv | Imod) -> (* handled via calls to millicode *)
       let rs' = [|phys_reg 20; phys_reg 19|] (* %r26, %r25 *)
index 86d2691728ca469eb951c8cb02167beea819ee01..6be4a18cdb9e7665cb2456e01f48b12f2af99bb4 100644 (file)
@@ -64,7 +64,7 @@ method is_immediate_add n = n >= -8192 && n < 8192
 
 method select_addressing arg = (Iindexed, arg)
 
-method select_operation op args =
+method! select_operation op args =
   let norm_op =
     match op with Cadda -> Caddi | Csuba -> Csubi | _ -> op in
   let norm_args =
@@ -146,7 +146,7 @@ method private select_imul_imm arg n =
       ...
     Note: we use two temp regs and perform stores by groups of 2
     in order to expose more instruction-level parallelism. *)
-method emit_stores env data regs_addr =
+method! emit_stores env data regs_addr =
   let t1 = Reg.create Addr and t2 = Reg.create Addr in
   self#insert (Iop(Iintop_imm(Iadd, -8))) regs_addr [|t1|];
   self#insert (Iop Imove) regs_addr [|t2|];
index 2818c4fd571be26ded858dea896b803d27be57ca..d87b300ccbf81b6559398fb32da3b8e5b739325e 100644 (file)
@@ -63,7 +63,7 @@ method select_addressing exp =
       then (Iindexed2, Ctuple[e1; e2])
       else (Iindexed d, Cop(Cadda, [e1; e2]))
 
-method select_operation op args =
+method! select_operation op args =
   match (op, args) with
   (* Prevent the recognition of (x / cst) and (x % cst) when cst is not
      a power of 2, which do not correspond to an instruction. *)
index 1053854740517a0b4e46050e867b337723854c96..965680b65ed09b0eb5adc3971d9e9f1291576337 100644 (file)
@@ -38,7 +38,7 @@ method select_addressing = function
   | arg ->
       (Iindexed 0, arg)
 
-method select_operation op args =
+method! select_operation op args =
   match (op, args) with
   (* For SPARC V7 multiplication, division and modulus are turned into
      calls to C library routines, except if the dividend is a power of 2.
@@ -65,7 +65,7 @@ method select_operation op args =
 
 (* Override insert_move_args to deal correctly with floating-point
    arguments being passed into pairs of integer registers. *)
-method insert_move_args arg loc stacksize =
+method! insert_move_args arg loc stacksize =
   if stacksize <> 0 then self#insert (Iop(Istackoffset stacksize)) [||] [||];
   let locpos = ref 0 in
   for i = 0 to Array.length arg - 1 do
index 55f30ceded683dc495eec16721549a50fd381241..9c70fd7b7c74f45a22dcfeec611af93cc0ef0729 100644 (file)
@@ -1,3 +1,5 @@
+libasmrun.a
+libasmrunp.a
 main.c
 misc.c
 freelist.c
@@ -32,3 +34,4 @@ globroots.c
 unix.c
 dynlink.c
 signals.c
+debugger.c
index 6b66a0c3a77ea0cc9bf493c96431915e394da2f2..ab5bde8560e31a3d9b07be57903d04883f6162b9 100644 (file)
 alloc.o: alloc.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/custom.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/stacks.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/custom.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/minor_gc.h ../byterun/mlvalues.h ../byterun/stacks.h \
+ ../byterun/memory.h
 array.o: array.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h
 backtrace.o: backtrace.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/backtrace.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h stack.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/backtrace.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/misc.h ../byterun/mlvalues.h stack.h
 callback.o: callback.c ../byterun/callback.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/misc.h ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/mlvalues.h
 compact.o: compact.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/finalise.h ../byterun/roots.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc_ctrl.h \
-  ../byterun/misc.h ../byterun/weak.h ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/finalise.h ../byterun/roots.h \
+ ../byterun/misc.h ../byterun/config.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/freelist.h \
+ ../byterun/gc.h ../byterun/gc_ctrl.h ../byterun/major_gc.h \
+ ../byterun/memory.h ../byterun/mlvalues.h ../byterun/roots.h \
+ ../byterun/weak.h
 compare.o: compare.c ../byterun/custom.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/misc.h ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h
 custom.o: custom.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/custom.h ../byterun/mlvalues.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/custom.h ../byterun/fail.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/mlvalues.h
+debugger.o: debugger.c ../byterun/config.h ../byterun/../config/m.h \
+ ../byterun/../config/s.h ../byterun/debugger.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/misc.h
 dynlink.o: dynlink.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/dynlink.h ../byterun/misc.h \
-  ../byterun/fail.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/osdeps.h ../byterun/misc.h \
-  ../byterun/prims.h
+ ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/dynlink.h \
+ ../byterun/fail.h ../byterun/mlvalues.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/misc.h ../byterun/osdeps.h \
+ ../byterun/prims.h
 extern.o: extern.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/custom.h ../byterun/mlvalues.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/intext.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/io.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/reverse.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/custom.h ../byterun/fail.h \
+ ../byterun/gc.h ../byterun/intext.h ../byterun/io.h ../byterun/io.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/misc.h \
+ ../byterun/mlvalues.h ../byterun/reverse.h
 fail.o: fail.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/io.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/printexc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/signals.h ../byterun/misc.h \
-  ../byterun/mlvalues.h stack.h ../byterun/roots.h ../byterun/misc.h \
-  ../byterun/memory.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/io.h ../byterun/gc.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/mlvalues.h ../byterun/printexc.h \
+ ../byterun/signals.h stack.h ../byterun/roots.h ../byterun/memory.h
 finalise.o: finalise.c ../byterun/callback.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/roots.h \
-  ../byterun/misc.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/signals.h \
-  ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/misc.h ../byterun/fail.h ../byterun/mlvalues.h \
+ ../byterun/roots.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/signals.h
 floats.o: floats.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/fail.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/reverse.h ../byterun/stacks.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/fail.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/mlvalues.h ../byterun/misc.h \
+ ../byterun/reverse.h ../byterun/stacks.h ../byterun/memory.h
 freelist.o: freelist.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/gc_ctrl.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/freelist.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/gc.h \
+ ../byterun/gc_ctrl.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/major_gc.h ../byterun/misc.h ../byterun/mlvalues.h
 gc_ctrl.o: gc_ctrl.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/compact.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/custom.h ../byterun/mlvalues.h ../byterun/finalise.h \
-  ../byterun/roots.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/gc_ctrl.h ../byterun/misc.h ../byterun/stacks.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/compact.h ../byterun/custom.h \
+ ../byterun/finalise.h ../byterun/roots.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/freelist.h ../byterun/gc.h \
+ ../byterun/gc_ctrl.h ../byterun/major_gc.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h stack.h
 globroots.o: globroots.c ../byterun/memory.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/roots.h ../byterun/misc.h \
-  ../byterun/memory.h ../byterun/globroots.h ../byterun/mlvalues.h \
-  ../byterun/roots.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/gc.h \
+ ../byterun/mlvalues.h ../byterun/misc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/misc.h \
+ ../byterun/mlvalues.h ../byterun/roots.h ../byterun/memory.h \
+ ../byterun/globroots.h ../byterun/roots.h
 hash.o: hash.c ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/custom.h ../byterun/mlvalues.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/misc.h \
+ ../byterun/custom.h ../byterun/mlvalues.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h
 intern.o: intern.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/custom.h ../byterun/mlvalues.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/intext.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/io.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/reverse.h ../byterun/md5.h \
-  ../byterun/mlvalues.h ../byterun/io.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/custom.h ../byterun/fail.h \
+ ../byterun/gc.h ../byterun/intext.h ../byterun/io.h ../byterun/io.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/mlvalues.h \
+ ../byterun/misc.h ../byterun/reverse.h ../byterun/md5.h
 ints.o: ints.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/custom.h \
-  ../byterun/mlvalues.h ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/intext.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/io.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/int64_native.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/custom.h ../byterun/fail.h ../byterun/intext.h \
+ ../byterun/io.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h ../byterun/int64_native.h
 io.o: io.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/custom.h ../byterun/mlvalues.h \
-  ../byterun/fail.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/io.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/signals.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/sys.h ../byterun/misc.h
+ ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/custom.h \
+ ../byterun/fail.h ../byterun/io.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h ../byterun/signals.h \
+ ../byterun/sys.h
 lexing.o: lexing.c ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/stacks.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/mlvalues.h ../byterun/stacks.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h
 main.o: main.c ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/sys.h \
-  ../byterun/misc.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/misc.h ../byterun/sys.h
 major_gc.o: major_gc.c ../byterun/compact.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/custom.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/finalise.h \
-  ../byterun/roots.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/gc_ctrl.h ../byterun/misc.h ../byterun/weak.h \
-  ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/misc.h \
+ ../byterun/custom.h ../byterun/mlvalues.h ../byterun/config.h \
+ ../byterun/fail.h ../byterun/finalise.h ../byterun/roots.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/freelist.h \
+ ../byterun/gc.h ../byterun/gc_ctrl.h ../byterun/major_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h ../byterun/roots.h \
+ ../byterun/weak.h
 md5.o: md5.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/md5.h \
-  ../byterun/mlvalues.h ../byterun/io.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/reverse.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/md5.h ../byterun/io.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/mlvalues.h ../byterun/io.h \
+ ../byterun/reverse.h
 memory.o: memory.c ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/gc_ctrl.h \
-  ../byterun/misc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/major_gc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/signals.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/freelist.h ../byterun/gc.h \
+ ../byterun/gc_ctrl.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/minor_gc.h ../byterun/minor_gc.h ../byterun/misc.h \
+ ../byterun/mlvalues.h ../byterun/signals.h
 meta.o: meta.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/fix_code.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/interp.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/intext.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/io.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/prims.h \
-  ../byterun/stacks.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/config.h ../byterun/fail.h ../byterun/fix_code.h \
+ ../byterun/interp.h ../byterun/intext.h ../byterun/io.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/minor_gc.h \
+ ../byterun/minor_gc.h ../byterun/misc.h ../byterun/mlvalues.h \
+ ../byterun/prims.h ../byterun/stacks.h ../byterun/memory.h
 minor_gc.o: minor_gc.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/finalise.h ../byterun/roots.h \
-  ../byterun/misc.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc_ctrl.h \
-  ../byterun/misc.h ../byterun/signals.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/weak.h ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/fail.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/finalise.h \
+ ../byterun/roots.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/gc.h ../byterun/gc_ctrl.h ../byterun/major_gc.h \
+ ../byterun/memory.h ../byterun/minor_gc.h ../byterun/misc.h \
+ ../byterun/mlvalues.h ../byterun/roots.h ../byterun/signals.h \
+ ../byterun/weak.h
 misc.o: misc.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/misc.h ../byterun/config.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/mlvalues.h \
+ ../byterun/misc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h
 natdynlink.o: natdynlink.c ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h stack.h \
-  ../byterun/callback.h ../byterun/mlvalues.h ../byterun/alloc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h natdynlink.h \
-  ../byterun/osdeps.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/misc.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h stack.h ../byterun/callback.h ../byterun/alloc.h \
+ natdynlink.h ../byterun/osdeps.h ../byterun/fail.h
 obj.o: obj.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/interp.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/major_gc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/prims.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/gc.h ../byterun/interp.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/minor_gc.h \
+ ../byterun/minor_gc.h ../byterun/misc.h ../byterun/mlvalues.h \
+ ../byterun/prims.h
 parsing.o: parsing.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/alloc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/mlvalues.h ../byterun/config.h \
+ ../byterun/misc.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/alloc.h
 printexc.o: printexc.c ../byterun/backtrace.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/callback.h \
-  ../byterun/mlvalues.h ../byterun/debugger.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/printexc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/misc.h ../byterun/callback.h ../byterun/debugger.h \
+ ../byterun/fail.h ../byterun/misc.h ../byterun/mlvalues.h \
+ ../byterun/printexc.h
 roots.o: roots.c ../byterun/finalise.h ../byterun/roots.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/globroots.h ../byterun/mlvalues.h \
-  ../byterun/roots.h stack.h
+ ../byterun/misc.h ../byterun/config.h ../byterun/../config/m.h \
+ ../byterun/../config/s.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/globroots.h ../byterun/memory.h \
+ ../byterun/major_gc.h ../byterun/minor_gc.h ../byterun/misc.h \
+ ../byterun/mlvalues.h stack.h ../byterun/roots.h
 signals.o: signals.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/callback.h ../byterun/mlvalues.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/roots.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/signals.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/signals_machdep.h ../byterun/sys.h ../byterun/misc.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/callback.h ../byterun/config.h \
+ ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h ../byterun/roots.h \
+ ../byterun/memory.h ../byterun/signals.h ../byterun/signals_machdep.h \
+ ../byterun/sys.h
 signals_asm.o: signals_asm.c ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/osdeps.h ../byterun/misc.h \
-  ../byterun/signals.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/signals_machdep.h signals_osdep.h stack.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/osdeps.h ../byterun/signals.h ../byterun/signals_machdep.h \
+ signals_osdep.h stack.h
 startup.o: startup.c ../byterun/callback.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/backtrace.h \
-  ../byterun/mlvalues.h ../byterun/custom.h ../byterun/mlvalues.h \
-  ../byterun/fail.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/gc_ctrl.h \
-  ../byterun/misc.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/osdeps.h \
-  ../byterun/misc.h ../byterun/printexc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/sys.h ../byterun/misc.h natdynlink.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/misc.h ../byterun/backtrace.h ../byterun/custom.h \
+ ../byterun/fail.h ../byterun/freelist.h ../byterun/gc.h \
+ ../byterun/gc_ctrl.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h ../byterun/osdeps.h \
+ ../byterun/printexc.h stack.h ../byterun/sys.h natdynlink.h
 str.o: str.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/mlvalues.h ../byterun/misc.h
 sys.o: sys.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/debugger.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/instruct.h ../byterun/osdeps.h \
-  ../byterun/misc.h ../byterun/signals.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/stacks.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/sys.h \
-  ../byterun/misc.h
+ ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/debugger.h \
+ ../byterun/fail.h ../byterun/instruct.h ../byterun/mlvalues.h \
+ ../byterun/osdeps.h ../byterun/signals.h ../byterun/stacks.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/sys.h
 terminfo.o: terminfo.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/io.h ../byterun/misc.h \
-  ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/fail.h \
+ ../byterun/io.h ../byterun/mlvalues.h
 unix.o: unix.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/osdeps.h \
-  ../byterun/misc.h
+ ../byterun/../config/s.h ../byterun/memory.h ../byterun/config.h \
+ ../byterun/gc.h ../byterun/mlvalues.h ../byterun/misc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/osdeps.h
 weak.o: weak.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/minor_gc.h ../byterun/mlvalues.h
 alloc.d.o: alloc.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/custom.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/stacks.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/custom.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/minor_gc.h ../byterun/mlvalues.h ../byterun/stacks.h \
+ ../byterun/memory.h
 array.d.o: array.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h
 backtrace.d.o: backtrace.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/backtrace.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h stack.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/backtrace.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/misc.h ../byterun/mlvalues.h stack.h
 callback.d.o: callback.c ../byterun/callback.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/misc.h ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/mlvalues.h
 compact.d.o: compact.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/finalise.h ../byterun/roots.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc_ctrl.h \
-  ../byterun/misc.h ../byterun/weak.h ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/finalise.h ../byterun/roots.h \
+ ../byterun/misc.h ../byterun/config.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/freelist.h \
+ ../byterun/gc.h ../byterun/gc_ctrl.h ../byterun/major_gc.h \
+ ../byterun/memory.h ../byterun/mlvalues.h ../byterun/roots.h \
+ ../byterun/weak.h
 compare.d.o: compare.c ../byterun/custom.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/misc.h ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h
 custom.d.o: custom.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/custom.h ../byterun/mlvalues.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/custom.h ../byterun/fail.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/mlvalues.h
+debugger.d.o: debugger.c ../byterun/config.h ../byterun/../config/m.h \
+ ../byterun/../config/s.h ../byterun/debugger.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/misc.h
 dynlink.d.o: dynlink.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/dynlink.h ../byterun/misc.h \
-  ../byterun/fail.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/osdeps.h ../byterun/misc.h \
-  ../byterun/prims.h
+ ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/dynlink.h \
+ ../byterun/fail.h ../byterun/mlvalues.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/misc.h ../byterun/osdeps.h \
+ ../byterun/prims.h
 extern.d.o: extern.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/custom.h ../byterun/mlvalues.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/intext.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/io.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/reverse.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/custom.h ../byterun/fail.h \
+ ../byterun/gc.h ../byterun/intext.h ../byterun/io.h ../byterun/io.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/misc.h \
+ ../byterun/mlvalues.h ../byterun/reverse.h
 fail.d.o: fail.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/io.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/printexc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/signals.h ../byterun/misc.h \
-  ../byterun/mlvalues.h stack.h ../byterun/roots.h ../byterun/misc.h \
-  ../byterun/memory.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/io.h ../byterun/gc.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/mlvalues.h ../byterun/printexc.h \
+ ../byterun/signals.h stack.h ../byterun/roots.h ../byterun/memory.h
 finalise.d.o: finalise.c ../byterun/callback.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/roots.h \
-  ../byterun/misc.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/signals.h \
-  ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/misc.h ../byterun/fail.h ../byterun/mlvalues.h \
+ ../byterun/roots.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/signals.h
 floats.d.o: floats.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/fail.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/reverse.h ../byterun/stacks.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/fail.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/mlvalues.h ../byterun/misc.h \
+ ../byterun/reverse.h ../byterun/stacks.h ../byterun/memory.h
 freelist.d.o: freelist.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/gc_ctrl.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/freelist.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/gc.h \
+ ../byterun/gc_ctrl.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/major_gc.h ../byterun/misc.h ../byterun/mlvalues.h
 gc_ctrl.d.o: gc_ctrl.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/compact.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/custom.h ../byterun/mlvalues.h ../byterun/finalise.h \
-  ../byterun/roots.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/gc_ctrl.h ../byterun/misc.h ../byterun/stacks.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/compact.h ../byterun/custom.h \
+ ../byterun/finalise.h ../byterun/roots.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/freelist.h ../byterun/gc.h \
+ ../byterun/gc_ctrl.h ../byterun/major_gc.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h stack.h
 globroots.d.o: globroots.c ../byterun/memory.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/roots.h ../byterun/misc.h \
-  ../byterun/memory.h ../byterun/globroots.h ../byterun/mlvalues.h \
-  ../byterun/roots.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/gc.h \
+ ../byterun/mlvalues.h ../byterun/misc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/misc.h \
+ ../byterun/mlvalues.h ../byterun/roots.h ../byterun/memory.h \
+ ../byterun/globroots.h ../byterun/roots.h
 hash.d.o: hash.c ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/custom.h ../byterun/mlvalues.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/misc.h \
+ ../byterun/custom.h ../byterun/mlvalues.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h
 intern.d.o: intern.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/custom.h ../byterun/mlvalues.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/intext.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/io.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/reverse.h ../byterun/md5.h \
-  ../byterun/mlvalues.h ../byterun/io.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/custom.h ../byterun/fail.h \
+ ../byterun/gc.h ../byterun/intext.h ../byterun/io.h ../byterun/io.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/mlvalues.h \
+ ../byterun/misc.h ../byterun/reverse.h ../byterun/md5.h
 ints.d.o: ints.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/custom.h \
-  ../byterun/mlvalues.h ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/intext.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/io.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/int64_native.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/custom.h ../byterun/fail.h ../byterun/intext.h \
+ ../byterun/io.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h ../byterun/int64_native.h
 io.d.o: io.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/custom.h ../byterun/mlvalues.h \
-  ../byterun/fail.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/io.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/signals.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/sys.h ../byterun/misc.h
+ ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/custom.h \
+ ../byterun/fail.h ../byterun/io.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h ../byterun/signals.h \
+ ../byterun/sys.h
 lexing.d.o: lexing.c ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/stacks.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/mlvalues.h ../byterun/stacks.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h
 main.d.o: main.c ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/sys.h \
-  ../byterun/misc.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/misc.h ../byterun/sys.h
 major_gc.d.o: major_gc.c ../byterun/compact.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/custom.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/finalise.h \
-  ../byterun/roots.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/gc_ctrl.h ../byterun/misc.h ../byterun/weak.h \
-  ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/misc.h \
+ ../byterun/custom.h ../byterun/mlvalues.h ../byterun/config.h \
+ ../byterun/fail.h ../byterun/finalise.h ../byterun/roots.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/freelist.h \
+ ../byterun/gc.h ../byterun/gc_ctrl.h ../byterun/major_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h ../byterun/roots.h \
+ ../byterun/weak.h
 md5.d.o: md5.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/md5.h \
-  ../byterun/mlvalues.h ../byterun/io.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/reverse.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/md5.h ../byterun/io.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/mlvalues.h ../byterun/io.h \
+ ../byterun/reverse.h
 memory.d.o: memory.c ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/gc_ctrl.h \
-  ../byterun/misc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/major_gc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/signals.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/freelist.h ../byterun/gc.h \
+ ../byterun/gc_ctrl.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/minor_gc.h ../byterun/minor_gc.h ../byterun/misc.h \
+ ../byterun/mlvalues.h ../byterun/signals.h
 meta.d.o: meta.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/fix_code.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/interp.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/intext.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/io.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/prims.h \
-  ../byterun/stacks.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/config.h ../byterun/fail.h ../byterun/fix_code.h \
+ ../byterun/interp.h ../byterun/intext.h ../byterun/io.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/minor_gc.h \
+ ../byterun/minor_gc.h ../byterun/misc.h ../byterun/mlvalues.h \
+ ../byterun/prims.h ../byterun/stacks.h ../byterun/memory.h
 minor_gc.d.o: minor_gc.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/finalise.h ../byterun/roots.h \
-  ../byterun/misc.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc_ctrl.h \
-  ../byterun/misc.h ../byterun/signals.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/weak.h ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/fail.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/finalise.h \
+ ../byterun/roots.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/gc.h ../byterun/gc_ctrl.h ../byterun/major_gc.h \
+ ../byterun/memory.h ../byterun/minor_gc.h ../byterun/misc.h \
+ ../byterun/mlvalues.h ../byterun/roots.h ../byterun/signals.h \
+ ../byterun/weak.h
 misc.d.o: misc.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/misc.h ../byterun/config.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/mlvalues.h \
+ ../byterun/misc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h
 natdynlink.d.o: natdynlink.c ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h stack.h \
-  ../byterun/callback.h ../byterun/mlvalues.h ../byterun/alloc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h natdynlink.h \
-  ../byterun/osdeps.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/misc.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h stack.h ../byterun/callback.h ../byterun/alloc.h \
+ natdynlink.h ../byterun/osdeps.h ../byterun/fail.h
 obj.d.o: obj.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/interp.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/major_gc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/prims.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/gc.h ../byterun/interp.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/minor_gc.h \
+ ../byterun/minor_gc.h ../byterun/misc.h ../byterun/mlvalues.h \
+ ../byterun/prims.h
 parsing.d.o: parsing.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/alloc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/mlvalues.h ../byterun/config.h \
+ ../byterun/misc.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/alloc.h
 printexc.d.o: printexc.c ../byterun/backtrace.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/callback.h \
-  ../byterun/mlvalues.h ../byterun/debugger.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/printexc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/misc.h ../byterun/callback.h ../byterun/debugger.h \
+ ../byterun/fail.h ../byterun/misc.h ../byterun/mlvalues.h \
+ ../byterun/printexc.h
 roots.d.o: roots.c ../byterun/finalise.h ../byterun/roots.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/globroots.h ../byterun/mlvalues.h \
-  ../byterun/roots.h stack.h
+ ../byterun/misc.h ../byterun/config.h ../byterun/../config/m.h \
+ ../byterun/../config/s.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/globroots.h ../byterun/memory.h \
+ ../byterun/major_gc.h ../byterun/minor_gc.h ../byterun/misc.h \
+ ../byterun/mlvalues.h stack.h ../byterun/roots.h
 signals.d.o: signals.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/callback.h ../byterun/mlvalues.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/roots.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/signals.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/signals_machdep.h ../byterun/sys.h ../byterun/misc.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/callback.h ../byterun/config.h \
+ ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h ../byterun/roots.h \
+ ../byterun/memory.h ../byterun/signals.h ../byterun/signals_machdep.h \
+ ../byterun/sys.h
 signals_asm.d.o: signals_asm.c ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/osdeps.h ../byterun/misc.h \
-  ../byterun/signals.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/signals_machdep.h signals_osdep.h stack.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/osdeps.h ../byterun/signals.h ../byterun/signals_machdep.h \
+ signals_osdep.h stack.h
 startup.d.o: startup.c ../byterun/callback.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/backtrace.h \
-  ../byterun/mlvalues.h ../byterun/custom.h ../byterun/mlvalues.h \
-  ../byterun/fail.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/gc_ctrl.h \
-  ../byterun/misc.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/osdeps.h \
-  ../byterun/misc.h ../byterun/printexc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/sys.h ../byterun/misc.h natdynlink.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/misc.h ../byterun/backtrace.h ../byterun/custom.h \
+ ../byterun/fail.h ../byterun/freelist.h ../byterun/gc.h \
+ ../byterun/gc_ctrl.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h ../byterun/osdeps.h \
+ ../byterun/printexc.h stack.h ../byterun/sys.h natdynlink.h
 str.d.o: str.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/mlvalues.h ../byterun/misc.h
 sys.d.o: sys.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/debugger.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/instruct.h ../byterun/osdeps.h \
-  ../byterun/misc.h ../byterun/signals.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/stacks.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/sys.h \
-  ../byterun/misc.h
+ ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/debugger.h \
+ ../byterun/fail.h ../byterun/instruct.h ../byterun/mlvalues.h \
+ ../byterun/osdeps.h ../byterun/signals.h ../byterun/stacks.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/sys.h
 terminfo.d.o: terminfo.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/io.h ../byterun/misc.h \
-  ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/fail.h \
+ ../byterun/io.h ../byterun/mlvalues.h
 unix.d.o: unix.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/osdeps.h \
-  ../byterun/misc.h
+ ../byterun/../config/s.h ../byterun/memory.h ../byterun/config.h \
+ ../byterun/gc.h ../byterun/mlvalues.h ../byterun/misc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/osdeps.h
 weak.d.o: weak.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/minor_gc.h ../byterun/mlvalues.h
 alloc.p.o: alloc.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/custom.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/stacks.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/custom.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/minor_gc.h ../byterun/mlvalues.h ../byterun/stacks.h \
+ ../byterun/memory.h
 array.p.o: array.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h
 backtrace.p.o: backtrace.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/backtrace.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h stack.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/backtrace.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/misc.h ../byterun/mlvalues.h stack.h
 callback.p.o: callback.c ../byterun/callback.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/misc.h ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/mlvalues.h
 compact.p.o: compact.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/finalise.h ../byterun/roots.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc_ctrl.h \
-  ../byterun/misc.h ../byterun/weak.h ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/finalise.h ../byterun/roots.h \
+ ../byterun/misc.h ../byterun/config.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/freelist.h \
+ ../byterun/gc.h ../byterun/gc_ctrl.h ../byterun/major_gc.h \
+ ../byterun/memory.h ../byterun/mlvalues.h ../byterun/roots.h \
+ ../byterun/weak.h
 compare.p.o: compare.c ../byterun/custom.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/misc.h ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h
 custom.p.o: custom.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/custom.h ../byterun/mlvalues.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/custom.h ../byterun/fail.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/mlvalues.h
+debugger.p.o: debugger.c ../byterun/config.h ../byterun/../config/m.h \
+ ../byterun/../config/s.h ../byterun/debugger.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/misc.h
 dynlink.p.o: dynlink.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/dynlink.h ../byterun/misc.h \
-  ../byterun/fail.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/osdeps.h ../byterun/misc.h \
-  ../byterun/prims.h
+ ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/dynlink.h \
+ ../byterun/fail.h ../byterun/mlvalues.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/misc.h ../byterun/osdeps.h \
+ ../byterun/prims.h
 extern.p.o: extern.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/custom.h ../byterun/mlvalues.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/intext.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/io.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/reverse.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/custom.h ../byterun/fail.h \
+ ../byterun/gc.h ../byterun/intext.h ../byterun/io.h ../byterun/io.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/misc.h \
+ ../byterun/mlvalues.h ../byterun/reverse.h
 fail.p.o: fail.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/io.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/printexc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/signals.h ../byterun/misc.h \
-  ../byterun/mlvalues.h stack.h ../byterun/roots.h ../byterun/misc.h \
-  ../byterun/memory.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/io.h ../byterun/gc.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/mlvalues.h ../byterun/printexc.h \
+ ../byterun/signals.h stack.h ../byterun/roots.h ../byterun/memory.h
 finalise.p.o: finalise.c ../byterun/callback.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/roots.h \
-  ../byterun/misc.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/signals.h \
-  ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/misc.h ../byterun/fail.h ../byterun/mlvalues.h \
+ ../byterun/roots.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/signals.h
 floats.p.o: floats.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/fail.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/reverse.h ../byterun/stacks.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/fail.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/mlvalues.h ../byterun/misc.h \
+ ../byterun/reverse.h ../byterun/stacks.h ../byterun/memory.h
 freelist.p.o: freelist.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/gc_ctrl.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/freelist.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/gc.h \
+ ../byterun/gc_ctrl.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/major_gc.h ../byterun/misc.h ../byterun/mlvalues.h
 gc_ctrl.p.o: gc_ctrl.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/compact.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/custom.h ../byterun/mlvalues.h ../byterun/finalise.h \
-  ../byterun/roots.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/gc_ctrl.h ../byterun/misc.h ../byterun/stacks.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/compact.h ../byterun/custom.h \
+ ../byterun/finalise.h ../byterun/roots.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/freelist.h ../byterun/gc.h \
+ ../byterun/gc_ctrl.h ../byterun/major_gc.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h stack.h
 globroots.p.o: globroots.c ../byterun/memory.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/roots.h ../byterun/misc.h \
-  ../byterun/memory.h ../byterun/globroots.h ../byterun/mlvalues.h \
-  ../byterun/roots.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/gc.h \
+ ../byterun/mlvalues.h ../byterun/misc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/misc.h \
+ ../byterun/mlvalues.h ../byterun/roots.h ../byterun/memory.h \
+ ../byterun/globroots.h ../byterun/roots.h
 hash.p.o: hash.c ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/custom.h ../byterun/mlvalues.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/misc.h \
+ ../byterun/custom.h ../byterun/mlvalues.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h
 intern.p.o: intern.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/custom.h ../byterun/mlvalues.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/intext.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/io.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/reverse.h ../byterun/md5.h \
-  ../byterun/mlvalues.h ../byterun/io.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/custom.h ../byterun/fail.h \
+ ../byterun/gc.h ../byterun/intext.h ../byterun/io.h ../byterun/io.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/mlvalues.h \
+ ../byterun/misc.h ../byterun/reverse.h ../byterun/md5.h
 ints.p.o: ints.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/custom.h \
-  ../byterun/mlvalues.h ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/intext.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/io.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/int64_native.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/custom.h ../byterun/fail.h ../byterun/intext.h \
+ ../byterun/io.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h ../byterun/int64_native.h
 io.p.o: io.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/custom.h ../byterun/mlvalues.h \
-  ../byterun/fail.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/io.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/signals.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/sys.h ../byterun/misc.h
+ ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/custom.h \
+ ../byterun/fail.h ../byterun/io.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h ../byterun/signals.h \
+ ../byterun/sys.h
 lexing.p.o: lexing.c ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/stacks.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/mlvalues.h ../byterun/stacks.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h
 main.p.o: main.c ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/sys.h \
-  ../byterun/misc.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/misc.h ../byterun/sys.h
 major_gc.p.o: major_gc.c ../byterun/compact.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/custom.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/finalise.h \
-  ../byterun/roots.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/gc_ctrl.h ../byterun/misc.h ../byterun/weak.h \
-  ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/misc.h \
+ ../byterun/custom.h ../byterun/mlvalues.h ../byterun/config.h \
+ ../byterun/fail.h ../byterun/finalise.h ../byterun/roots.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/freelist.h \
+ ../byterun/gc.h ../byterun/gc_ctrl.h ../byterun/major_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h ../byterun/roots.h \
+ ../byterun/weak.h
 md5.p.o: md5.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/md5.h \
-  ../byterun/mlvalues.h ../byterun/io.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/reverse.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/md5.h ../byterun/io.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/mlvalues.h ../byterun/io.h \
+ ../byterun/reverse.h
 memory.p.o: memory.c ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/gc_ctrl.h \
-  ../byterun/misc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/major_gc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/signals.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/freelist.h ../byterun/gc.h \
+ ../byterun/gc_ctrl.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/minor_gc.h ../byterun/minor_gc.h ../byterun/misc.h \
+ ../byterun/mlvalues.h ../byterun/signals.h
 meta.p.o: meta.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/fix_code.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/interp.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/intext.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/io.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/prims.h \
-  ../byterun/stacks.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/memory.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/config.h ../byterun/fail.h ../byterun/fix_code.h \
+ ../byterun/interp.h ../byterun/intext.h ../byterun/io.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/minor_gc.h \
+ ../byterun/minor_gc.h ../byterun/misc.h ../byterun/mlvalues.h \
+ ../byterun/prims.h ../byterun/stacks.h ../byterun/memory.h
 minor_gc.p.o: minor_gc.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/finalise.h ../byterun/roots.h \
-  ../byterun/misc.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc_ctrl.h \
-  ../byterun/misc.h ../byterun/signals.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/weak.h ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/fail.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/finalise.h \
+ ../byterun/roots.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/gc.h ../byterun/gc_ctrl.h ../byterun/major_gc.h \
+ ../byterun/memory.h ../byterun/minor_gc.h ../byterun/misc.h \
+ ../byterun/mlvalues.h ../byterun/roots.h ../byterun/signals.h \
+ ../byterun/weak.h
 misc.p.o: misc.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/misc.h ../byterun/config.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/mlvalues.h \
+ ../byterun/misc.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h
 natdynlink.p.o: natdynlink.c ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h stack.h \
-  ../byterun/callback.h ../byterun/mlvalues.h ../byterun/alloc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h natdynlink.h \
-  ../byterun/osdeps.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/misc.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h stack.h ../byterun/callback.h ../byterun/alloc.h \
+ natdynlink.h ../byterun/osdeps.h ../byterun/fail.h
 obj.p.o: obj.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/interp.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/major_gc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/prims.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/gc.h ../byterun/interp.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/memory.h \
+ ../byterun/gc.h ../byterun/major_gc.h ../byterun/minor_gc.h \
+ ../byterun/minor_gc.h ../byterun/misc.h ../byterun/mlvalues.h \
+ ../byterun/prims.h
 parsing.p.o: parsing.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/alloc.h ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/mlvalues.h ../byterun/config.h \
+ ../byterun/misc.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/alloc.h
 printexc.p.o: printexc.c ../byterun/backtrace.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/callback.h \
-  ../byterun/mlvalues.h ../byterun/debugger.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/printexc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/misc.h ../byterun/callback.h ../byterun/debugger.h \
+ ../byterun/fail.h ../byterun/misc.h ../byterun/mlvalues.h \
+ ../byterun/printexc.h
 roots.p.o: roots.c ../byterun/finalise.h ../byterun/roots.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/globroots.h ../byterun/mlvalues.h \
-  ../byterun/roots.h stack.h
+ ../byterun/misc.h ../byterun/config.h ../byterun/../config/m.h \
+ ../byterun/../config/s.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/minor_gc.h ../byterun/globroots.h ../byterun/memory.h \
+ ../byterun/major_gc.h ../byterun/minor_gc.h ../byterun/misc.h \
+ ../byterun/mlvalues.h stack.h ../byterun/roots.h
 signals.p.o: signals.c ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/callback.h ../byterun/mlvalues.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/memory.h \
-  ../byterun/config.h ../byterun/gc.h ../byterun/mlvalues.h \
-  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/misc.h ../byterun/minor_gc.h \
-  ../byterun/misc.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/roots.h ../byterun/misc.h ../byterun/memory.h \
-  ../byterun/signals.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/signals_machdep.h ../byterun/sys.h ../byterun/misc.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/callback.h ../byterun/config.h \
+ ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h ../byterun/roots.h \
+ ../byterun/memory.h ../byterun/signals.h ../byterun/signals_machdep.h \
+ ../byterun/sys.h
 signals_asm.p.o: signals_asm.c ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/mlvalues.h ../byterun/config.h ../byterun/misc.h \
-  ../byterun/memory.h ../byterun/config.h ../byterun/gc.h \
-  ../byterun/mlvalues.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/misc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/osdeps.h ../byterun/misc.h \
-  ../byterun/signals.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/signals_machdep.h signals_osdep.h stack.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/mlvalues.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/osdeps.h ../byterun/signals.h ../byterun/signals_machdep.h \
+ signals_osdep.h stack.h
 startup.p.o: startup.c ../byterun/callback.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/backtrace.h \
-  ../byterun/mlvalues.h ../byterun/custom.h ../byterun/mlvalues.h \
-  ../byterun/fail.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/gc_ctrl.h \
-  ../byterun/misc.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/osdeps.h \
-  ../byterun/misc.h ../byterun/printexc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/sys.h ../byterun/misc.h natdynlink.h
+ ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+ ../byterun/misc.h ../byterun/backtrace.h ../byterun/custom.h \
+ ../byterun/fail.h ../byterun/freelist.h ../byterun/gc.h \
+ ../byterun/gc_ctrl.h ../byterun/memory.h ../byterun/gc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/mlvalues.h ../byterun/osdeps.h \
+ ../byterun/printexc.h stack.h ../byterun/sys.h natdynlink.h
 str.p.o: str.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/mlvalues.h ../byterun/misc.h
 sys.p.o: sys.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/debugger.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/instruct.h ../byterun/osdeps.h \
-  ../byterun/misc.h ../byterun/signals.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/stacks.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/sys.h \
-  ../byterun/misc.h
+ ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/debugger.h \
+ ../byterun/fail.h ../byterun/instruct.h ../byterun/mlvalues.h \
+ ../byterun/osdeps.h ../byterun/signals.h ../byterun/stacks.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/sys.h
 terminfo.p.o: terminfo.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
-  ../byterun/config.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/fail.h ../byterun/misc.h \
-  ../byterun/mlvalues.h ../byterun/io.h ../byterun/misc.h \
-  ../byterun/mlvalues.h
+ ../byterun/../config/s.h ../byterun/alloc.h ../byterun/misc.h \
+ ../byterun/config.h ../byterun/mlvalues.h ../byterun/fail.h \
+ ../byterun/io.h ../byterun/mlvalues.h
 unix.p.o: unix.c ../byterun/config.h ../byterun/../config/m.h \
-  ../byterun/../config/s.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/config.h \
-  ../byterun/misc.h ../byterun/config.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/minor_gc.h ../byterun/misc.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/osdeps.h \
-  ../byterun/misc.h
+ ../byterun/../config/s.h ../byterun/memory.h ../byterun/config.h \
+ ../byterun/gc.h ../byterun/mlvalues.h ../byterun/misc.h \
+ ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+ ../byterun/misc.h ../byterun/osdeps.h
 weak.p.o: weak.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
-  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
-  ../byterun/config.h ../byterun/misc.h ../byterun/fail.h \
-  ../byterun/misc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/freelist.h ../byterun/misc.h ../byterun/mlvalues.h \
-  ../byterun/misc.h ../byterun/memory.h ../byterun/config.h \
-  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
-  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/misc.h \
-  ../byterun/mlvalues.h
+ ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+ ../byterun/fail.h ../byterun/major_gc.h ../byterun/freelist.h \
+ ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+ ../byterun/minor_gc.h ../byterun/mlvalues.h
index 633ce5254b3e1408136300e15fb3483068882e53..3e37ab1ea45454ef6fabde6a46353048fc42163a 100644 (file)
@@ -26,7 +26,7 @@ COBJS=startup.o main.o fail.o roots.o globroots.o signals.o signals_asm.o \
   misc.o freelist.o major_gc.o minor_gc.o memory.o alloc.o compare.o ints.o \
   floats.o str.o array.o io.o extern.o intern.o hash.o sys.o parsing.o \
   gc_ctrl.o terminfo.o md5.o obj.o lexing.o printexc.o callback.o weak.o \
-  compact.o finalise.o custom.o unix.o backtrace.o natdynlink.o
+  compact.o finalise.o custom.o unix.o backtrace.o natdynlink.o debugger.o
 
 ASMOBJS=$(ARCH).o
 
@@ -142,12 +142,14 @@ dynlink.c: ../byterun/dynlink.c
        ln -s ../byterun/dynlink.c dynlink.c
 signals.c: ../byterun/signals.c
        ln -s ../byterun/signals.c signals.c
+debugger.c: ../byterun/debugger.c
+       ln -s ../byterun/debugger.c debugger.c
 
 LINKEDFILES=misc.c freelist.c major_gc.c minor_gc.c memory.c alloc.c array.c \
   compare.c ints.c floats.c str.c io.c extern.c intern.c hash.c sys.c \
   parsing.c gc_ctrl.c terminfo.c md5.c obj.c lexing.c printexc.c callback.c \
   weak.c compact.c finalise.c meta.c custom.c main.c globroots.c unix.c \
-  dynlink.c signals.c
+  dynlink.c signals.c debugger.c
 
 clean::
        rm -f $(LINKEDFILES)
index ca24bc71ad55c087921cb2231b9441086c09aec1..75fe2614155647a5c195967998fe34c5fb1d68ad 100644 (file)
@@ -24,13 +24,13 @@ COBJS=startup.$(O) main.$(O) fail.$(O) roots.$(O) signals.$(O) signals_asm.$(O)
   intern.$(O) hash.$(O) sys.$(O) parsing.$(O) gc_ctrl.$(O) terminfo.$(O) \
   md5.$(O) obj.$(O) lexing.$(O) win32.$(O) printexc.$(O) callback.$(O) \
   weak.$(O) compact.$(O) finalise.$(O) custom.$(O) globroots.$(O) \
-  backtrace.$(O) natdynlink.$(O)
+  backtrace.$(O) natdynlink.$(O) debugger.$(O)
 
 LINKEDFILES=misc.c freelist.c major_gc.c minor_gc.c memory.c alloc.c array.c \
   compare.c ints.c floats.c str.c io.c extern.c intern.c hash.c sys.c \
   parsing.c gc_ctrl.c terminfo.c md5.c obj.c lexing.c printexc.c callback.c \
   weak.c compact.c meta.c finalise.c custom.c main.c globroots.c \
-  dynlink.c signals.c
+  dynlink.c signals.c debugger.c
 
 ifeq ($(TOOLCHAIN),mingw)
 ASMOBJS=$(ARCH).o
index 42172c944f9216484ab850e042c0b61493f4971c..97de5183994106210cedf4c1be243e59506db0da 100644 (file)
 
 FUNCTION(G(caml_call_gc))
         RECORD_STACK_FRAME(0)
-.L105:
+.Lcaml_call_gc:
     /* Build array of registers, save it into caml_gc_regs */
         pushq   %r13
         pushq   %r12
@@ -203,6 +203,7 @@ FUNCTION(G(caml_call_gc))
         ret
 
 FUNCTION(G(caml_alloc1))
+.Lcaml_alloc1:
         subq    $16, %r15
         CMP_VAR(caml_young_limit, %r15)
         jb      .L100
@@ -210,11 +211,12 @@ FUNCTION(G(caml_alloc1))
 .L100:
         RECORD_STACK_FRAME(0)
        subq    $8, %rsp
-        call    .L105
+        call    .Lcaml_call_gc
        addq    $8, %rsp
-        jmp     G(caml_alloc1)
+        jmp     .Lcaml_alloc1
 
 FUNCTION(G(caml_alloc2))
+.Lcaml_alloc2:
         subq    $24, %r15
         CMP_VAR(caml_young_limit, %r15)
         jb      .L101
@@ -222,11 +224,12 @@ FUNCTION(G(caml_alloc2))
 .L101:
         RECORD_STACK_FRAME(0)
        subq    $8, %rsp
-        call    .L105
+        call    .Lcaml_call_gc
        addq    $8, %rsp
-        jmp     G(caml_alloc2)
+        jmp     .Lcaml_alloc2
 
 FUNCTION(G(caml_alloc3))
+.Lcaml_alloc3:
         subq    $32, %r15
         CMP_VAR(caml_young_limit, %r15)
         jb      .L102
@@ -234,11 +237,12 @@ FUNCTION(G(caml_alloc3))
 .L102:
         RECORD_STACK_FRAME(0)
        subq    $8, %rsp
-        call    .L105
+        call    .Lcaml_call_gc
        addq    $8, %rsp
-        jmp     G(caml_alloc3)
+        jmp     .Lcaml_alloc3
 
 FUNCTION(G(caml_allocN))
+.Lcaml_allocN:
         pushq   %rax                       /* save desired size */
         subq    %rax, %r15
         CMP_VAR(caml_young_limit, %r15)
@@ -247,13 +251,14 @@ FUNCTION(G(caml_allocN))
         ret
 .L103:
         RECORD_STACK_FRAME(8)
-        call    .L105
+        call    .Lcaml_call_gc
         popq    %rax                      /* recover desired size */
-        jmp     G(caml_allocN)
+        jmp     .Lcaml_allocN
 
 /* Call a C function from Caml */
 
 FUNCTION(G(caml_c_call))
+.Lcaml_c_call:
     /* Record lowest stack address and return address */
         popq    %r12
         STORE_VAR(%r12, caml_last_return_address)
@@ -283,7 +288,7 @@ FUNCTION(G(caml_start_program))
     /* Initial entry point is G(caml_program) */
         leaq    GCALL(caml_program)(%rip), %r12
     /* Common code for caml_start_program and caml_callback* */
-.L106:
+.Lcaml_start_program:
     /* Build a callback link */
        subq    $8, %rsp        /* stack 16-aligned */
         PUSH_VAR(caml_gc_regs)
@@ -386,7 +391,7 @@ FUNCTION(G(caml_callback_exn))
         movq    %rdi, %rbx      /* closure */
         movq    %rsi, %rax      /* argument */
         movq    0(%rbx), %r12   /* code pointer */
-        jmp     .L106
+        jmp     .Lcaml_start_program
 
 FUNCTION(G(caml_callback2_exn))
     /* Save callee-save registers */
@@ -402,7 +407,7 @@ FUNCTION(G(caml_callback2_exn))
         movq    %rsi, %rax               /* first argument */
         movq    %rdx, %rbx               /* second argument */
         leaq    GCALL(caml_apply2)(%rip), %r12  /* code pointer */
-        jmp     .L106
+        jmp     .Lcaml_start_program
 
 FUNCTION(G(caml_callback3_exn))
     /* Save callee-save registers */
@@ -419,11 +424,11 @@ FUNCTION(G(caml_callback3_exn))
         movq    %rdi, %rsi               /* closure */
         movq    %rcx, %rdi               /* third argument */
         leaq    GCALL(caml_apply3)(%rip), %r12  /* code pointer */
-        jmp     .L106
+        jmp     .Lcaml_start_program
 
 FUNCTION(G(caml_ml_array_bound_error))
         leaq    GCALL(caml_array_bound_error)(%rip), %rax
-        jmp     G(caml_c_call)
+        jmp     .Lcaml_c_call
 
         .data
         .globl  G(caml_system__frametable)
index dad820f3b6c90389671c94d142c6d5e44c22c3cf..cb75a099cac30763997122cd88fb5ede92ca8824 100644 (file)
@@ -127,6 +127,7 @@ void caml_init_frame_descriptors(void)
 
 /* Communication with [caml_start_program] and [caml_call_gc]. */
 
+char * caml_top_of_stack;
 char * caml_bottom_of_stack = NULL; /* no stack initially */
 uintnat caml_last_return_address = 1; /* not in Caml code initially */
 value * caml_gc_regs;
@@ -357,3 +358,16 @@ void caml_do_local_roots(scanning_action f, char * bottom_of_stack,
     }
   }
 }
+
+uintnat (*caml_stack_usage_hook)(void) = NULL;
+
+uintnat caml_stack_usage (void)
+{
+  uintnat sz;
+  sz = (value *) caml_top_of_stack - (value *) caml_bottom_of_stack;
+  if (caml_stack_usage_hook != NULL)
+    sz += (*caml_stack_usage_hook)();
+  return sz;
+}
+
+
index 578e9cf87b96882fe34cfe0f90d67cc1817b3843..62a33e71fce2331ee6ded39d6b9cdd832a177b63 100644 (file)
@@ -117,7 +117,11 @@ extern void caml_init_frame_descriptors(void);
 extern void caml_register_frametable(intnat *);
 extern void caml_register_dyn_global(void *);
 
+extern uintnat caml_stack_usage (void);
+extern uintnat (*caml_stack_usage_hook)(void);
+
 /* Declaration of variables used in the asm code */
+extern char * caml_top_of_stack;
 extern char * caml_bottom_of_stack;
 extern uintnat caml_last_return_address;
 extern value * caml_gc_regs;
index d22e58fe41da2dbb416466898b9d66b4e6a1f9cb..8bfe762119ecd1d9830c726ad260181a894f9a10 100644 (file)
@@ -29,6 +29,7 @@
 #include "mlvalues.h"
 #include "osdeps.h"
 #include "printexc.h"
+#include "stack.h"
 #include "sys.h"
 #include "natdynlink.h"
 #ifdef HAS_UI
@@ -144,17 +145,20 @@ void caml_main(char **argv)
   static char proc_self_exe[256];
 #endif
   value res;
+  char tos;
 
   caml_init_ieee_floats();
   caml_init_custom_operations();
 #ifdef DEBUG
   caml_verb_gc = 63;
 #endif
+  caml_top_of_stack = &tos;
   parse_camlrunparam();
   caml_init_gc (minor_heap_init, heap_size_init, heap_chunk_init,
                 percent_free_init, max_percent_free_init);
   init_atoms();
   caml_init_signals();
+  caml_debugger_init (); /* force debugger.o stub to be linked */
   exe_name = argv[0];
   if (exe_name == NULL) exe_name = "";
 #ifdef __linux__
index 3340e82e3ed6b1df2071af0a305387fff8b125b7..142d937d3ac8086f501eb005ac38d45eae98adec 100755 (executable)
Binary files a/boot/ocamlc and b/boot/ocamlc differ
index 3ceee935a93af2ea0591f1ad73fcb66560ffc986..a61a315d02a4b02dd528e5e1314d8761c441ea32 100755 (executable)
Binary files a/boot/ocamldep and b/boot/ocamldep differ
index ebae626c689d1c80faeb91fff4128c835150a145..0b785adf08747b2870466d86f972e8a00619e53b 100755 (executable)
Binary files a/boot/ocamllex and b/boot/ocamllex differ
diff --git a/build/boot-c-parts-windows.sh b/build/boot-c-parts-windows.sh
deleted file mode 100755 (executable)
index 3e2ca3d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-# $Id$
-cd `dirname $0`/..
-set -ex
-
-. config/config.sh
-
-(cd byterun && make -f Makefile.nt)
-(cd asmrun && make -f Makefile.nt all meta.$O dynlink.$O)
-(cd yacc && make -f Makefile.nt)
-(cd win32caml && make)
-
-mkdir -p _build/boot
-cp -f byterun/ocamlrun.exe \
-      byterun/libcamlrun.$A \
-      asmrun/libasmrun.$A \
-      yacc/ocamlyacc.exe \
-      boot/ocamlc \
-      boot/ocamllex \
-      boot/ocamldep \
-      _build/boot
-mkdir -p _build/byterun
-cp -f byterun/ocamlrun.exe boot
index a38c16410332e2d487904774c7e28653393a8082..9999392e376411cefb9e298192e87c8c0f3d0d58 100755 (executable)
@@ -1,22 +1,37 @@
 #!/bin/sh
-# $Id$
 cd `dirname $0`/..
 set -ex
 
-# Create a bunch of symlinks to _build/boot
+. config/config.sh
+
+if "$WINDOWS"; then
+  MAKEOPTS='-f Makefile.nt'
+  LINK='cp -f'
+else
+  MAKEOPTS=''
+  LINK='ln -s -f'
+fi
+
+(cd byterun && make $MAKEOPTS)
+(cd asmrun && make $MAKEOPTS all meta."$O" dynlink."$O")
+(cd yacc && make $MAKEOPTS)
+
+if "$WINDOWS"; then
+  (cd win32caml && make)
+fi
+
 mkdir -p _build/boot
-ln -sf ../../byterun/ocamlrun \
-       ../../byterun/libcamlrun.a \
-       ../../asmrun/libasmrun.a \
-       ../../asmrun/libasmrunp.a \
-       ../../yacc/ocamlyacc \
-       ../../boot/ocamlc \
-       ../../boot/ocamllex \
-       ../../boot/ocamldep \
-       _build/boot
 
-[ -f boot/ocamlrun ] || ln -sf ../byterun/ocamlrun boot
+# Create a bunch of symlinks (or copies) to _build/boot
+(cd _build/boot &&
+$LINK ../../byterun/ocamlrun$EXE \
+      ../../byterun/libcamlrun.$A \
+      ../../asmrun/libasmrun.$A \
+      ../../yacc/ocamlyacc$EXE \
+      ../../boot/ocamlc \
+      ../../boot/ocamllex \
+      ../../boot/ocamldep \
+      . )
 
-(cd byterun && make)
-(cd asmrun && make all meta.o dynlink.o)
-(cd yacc && make)
+(cd boot &&
+[ -f boot/ocamlrun$EXE ] || $LINK ../byterun/ocamlrun$EXE . )
index 5c08e1aaeadf0f8851dec1b25109a15b1679dedc..10ffa812f8119ca376e9310fcf3187f8c8b7a1bf 100755 (executable)
@@ -24,12 +24,7 @@ if [ -e ocamlbuild_mixed_mode ]; then
 fi
 ./mkconfig.sh
 ./mkmyocamlbuild_config.sh
-. ../config/config.sh
-if [ "x$EXE" = "x.exe" -a "x$SYSTEM" != "xcygwin" ]; then
-  ./boot-c-parts-windows.sh
-else
-  ./boot-c-parts.sh
-fi
+./boot-c-parts.sh
 ./boot.sh $@
 
 cd ..
index 2197069c5b3893a2a6e721c0d49496505b653dfb..1a60a87ecc8659eaa6c00e60032eaf85bf31b6e8 100755 (executable)
@@ -344,10 +344,6 @@ installdir \
   otherlibs/labltk/lib/labltk.cma \
   otherlibs/labltk/lib/labltk.cmxa \
   otherlibs/labltk/lib/labltk.cmx \
-  otherlibs/labltk/tkanim/*.mli \
-  otherlibs/labltk/tkanim/*.cmi \
-  otherlibs/labltk/tkanim/tkanim.cma \
-  otherlibs/labltk/tkanim/tkanim.cmxa \
   otherlibs/labltk/compiler/tkcompiler \
   $LIBDIR/labltk
 
@@ -376,7 +372,6 @@ installdir \
   otherlibs/"$WIN32"unix/dllunix$EXT_DLL \
   otherlibs/threads/dllvmthreads$EXT_DLL \
   otherlibs/labltk/support/dlllabltk$EXT_DLL \
-  otherlibs/labltk/tkanim/dlltkanim$EXT_DLL \
   $STUBLIBDIR
 
 installlibdir \
@@ -403,8 +398,6 @@ installlibdir \
   otherlibs/labltk/support/liblabltk.$A \
   otherlibs/labltk/lib/labltk.$A \
   otherlibs/labltk/jpf/jpflib.$A \
-  otherlibs/labltk/tkanim/libtkanim.$A \
-  otherlibs/labltk/tkanim/tkanim.$A \
   otherlibs/labltk/frx/frxlib.$A \
   $LIBDIR/labltk
 
index 0eb693030def7cbab32eb671b545dbffe64310f3..d7c2d91ebc510ccabc39479def714dc45f2ee28e 100755 (executable)
@@ -1,5 +1,4 @@
 #!/bin/sh
-# $Id$
 
 cd `dirname $0`/..
 
@@ -8,3 +7,9 @@ sed -e 's/^\(.*\$([0-9]).*\)$/# \1/' \
     -e 's/^FLEX.*$//g' \
     -e 's/^\([^#=]*\)=\([^"]*\)$/if [ "x$\1" = "x" ]; then \1="\2"; fi/' \
     config/Makefile > config/config.sh
+
+if [ "x$EXE" = "x.exe" -a "x$SYSTEM" != "xcygwin" ]; then
+  echo "WINDOWS=true" >> config/config.sh
+else
+  echo "WINDOWS=false" >> config/config.sh
+fi
index b16f6deb83862ac89b855dc8b93f49df65a73609..690ea4ad10fc008ef0bba0f1a275eec111a97804 100644 (file)
@@ -12,17 +12,16 @@ utils/config.mlbuild # Should be renamed as utils/config.ml
 
 build/
   world.sh             # Build all the OCaml world
+    world.byte.sh        # Build the bytecode world
+    world.native.sh      # Build the native world
+    world.all.sh         # Build all the world the don't bootstrap
   fastworld.sh         # Same as above but faster
     boot-c-parts.sh         # Compile byterun, ocamlyacc and asmrun with the Makefiles
-    boot-c-parts-windows.sh # Same as boot-c-parts.sh but for windows
     boot.sh                 # Compile the stdlib and ocamlc
     camlp4-targets.sh       # Setup camlp4 targets
     otherlibs-targets.sh    # Setup otherlibs targets
     targets.sh              # All targets of the OCaml distribution
 
-  world.byte.sh        # Build the bytecode world
-  world.native.sh      # Build the native world
-  world.all.sh         # Build all the world the don't bootstrap
 
   install.sh           # Install all needed files
   distclean.sh         # Clean all generated files
@@ -34,7 +33,7 @@ build/
   camlp4-bootstrap.sh
 
   # Partial stuffs (just camlp4 and ocamlbuild)
-  partial-boot.sh
+  mixed-boot.sh
   camlp4-byte-only.sh
   camlp4-native-only.sh
   ocamlbuild-byte-only.sh
index 19980424358e8ca72e7f409b0fac84b018e64034..301b75f19136a586e4dc9aac3d73d6fc559cae69 100644 (file)
@@ -101,8 +101,6 @@ for lib in $OTHERLIBRARIES; do
     add_byte      lib/labltktop$EXE lib/labltk$EXE
     add_ocaml_lib jpf/jpflib
     add_ocaml_lib frx/frxlib
-    add_ocaml_lib tkanim/tkanim
-    add_file      tkanim/libtkanim.$A
     add_byte      browser/ocamlbrowser$EXE
     ;;
   dbm)
index bbe1632a94cfda92662d930e2c6133c77424ee1f..0b9a4b2891c7161009da9624c8ee59acaea32122 100755 (executable)
@@ -13,8 +13,6 @@
 #                                                                       #
 #########################################################################
 
-# $Id$
-
 cd `dirname $0`
 set -e
 if [ -e ocamlbuild_mixed_mode ]; then
@@ -22,13 +20,17 @@ if [ -e ocamlbuild_mixed_mode ]; then
   echo 'please cleanup and re-launch (make clean ; ./build/distclean.sh)'
   exit 1
 fi
+case "$1" in
+  all|a|al) mode=all;;
+  byte|b|by|byt) mode=byte;;
+  native|na|nat|nati|nativ) mode=native;;
+  *) echo 'Unexpected target. Expected targets are: all,byte,native' \
+       >/dev/stderr
+     exit 1;;
+esac
+shift
 ./mkconfig.sh
 ./mkmyocamlbuild_config.sh
-. ../config/config.sh
-if [ "x$EXE" = "x.exe" -a "x$SYSTEM" != "xcygwin" ]; then
-  ./boot-c-parts-windows.sh
-else
-  ./boot-c-parts.sh
-fi
-./boot.sh $@
-./world.all.sh $@
+./boot-c-parts.sh
+./boot.sh "$@"
+./world."$mode".sh "$@"
index b92cc6de2ac0e687d4ee646b28f3ea4a5d3b0d22..2044d56cecd24244ecf49b3cfc614325e327968a 100644 (file)
 alloc.o: alloc.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h custom.h major_gc.h freelist.h memory.h gc.h \
 minor_gc.h stacks.h
+ ../config/s.h mlvalues.h custom.h major_gc.h freelist.h memory.h gc.h \
+ minor_gc.h stacks.h
 array.o: array.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h
+ ../config/s.h mlvalues.h fail.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h
 backtrace.o: backtrace.c config.h ../config/m.h ../config/s.h \
 compatibility.h mlvalues.h misc.h alloc.h io.h instruct.h intext.h \
 fix_code.h exec.h memory.h gc.h major_gc.h freelist.h minor_gc.h \
 startup.h stacks.h sys.h backtrace.h
+ compatibility.h mlvalues.h misc.h alloc.h io.h instruct.h intext.h \
+ fix_code.h exec.h memory.h gc.h major_gc.h freelist.h minor_gc.h \
+ startup.h stacks.h sys.h backtrace.h
 callback.o: callback.c callback.h compatibility.h mlvalues.h config.h \
 ../config/m.h ../config/s.h misc.h fail.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h interp.h instruct.h fix_code.h stacks.h
+ ../config/m.h ../config/s.h misc.h fail.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h interp.h instruct.h fix_code.h stacks.h
 compact.o: compact.c config.h ../config/m.h ../config/s.h compatibility.h \
 finalise.h roots.h misc.h memory.h gc.h mlvalues.h major_gc.h \
 freelist.h minor_gc.h gc_ctrl.h weak.h
finalise.h roots.h misc.h memory.h gc.h mlvalues.h major_gc.h freelist.h \
+ minor_gc.h gc_ctrl.h weak.h
 compare.o: compare.c custom.h compatibility.h mlvalues.h config.h \
 ../config/m.h ../config/s.h misc.h fail.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h
+ ../config/m.h ../config/s.h misc.h fail.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h
 custom.o: custom.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h custom.h fail.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h
+ ../config/s.h mlvalues.h custom.h fail.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h
 debugger.o: debugger.c config.h ../config/m.h ../config/s.h \
 compatibility.h debugger.h misc.h mlvalues.h fail.h fix_code.h \
 instruct.h intext.h io.h stacks.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h sys.h
+ compatibility.h debugger.h misc.h mlvalues.h fail.h fix_code.h \
+ instruct.h intext.h io.h stacks.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h sys.h
 dynlink.o: dynlink.c config.h ../config/m.h ../config/s.h compatibility.h \
 alloc.h misc.h mlvalues.h dynlink.h fail.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h osdeps.h prims.h
+ alloc.h misc.h mlvalues.h dynlink.h fail.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h osdeps.h prims.h
 extern.o: extern.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h custom.h fail.h gc.h intext.h io.h fix_code.h \
 memory.h major_gc.h freelist.h minor_gc.h reverse.h
+ ../config/s.h mlvalues.h custom.h fail.h gc.h intext.h io.h fix_code.h \
+ memory.h major_gc.h freelist.h minor_gc.h reverse.h
 fail.o: fail.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h io.h gc.h memory.h major_gc.h \
 freelist.h minor_gc.h printexc.h signals.h stacks.h
../config/s.h mlvalues.h fail.h io.h gc.h memory.h major_gc.h freelist.h \
+ minor_gc.h printexc.h signals.h stacks.h
 finalise.o: finalise.c callback.h compatibility.h mlvalues.h config.h \
 ../config/m.h ../config/s.h misc.h fail.h roots.h memory.h gc.h \
 major_gc.h freelist.h minor_gc.h signals.h
+ ../config/m.h ../config/s.h misc.h fail.h roots.h memory.h gc.h \
+ major_gc.h freelist.h minor_gc.h signals.h
 fix_code.o: fix_code.c config.h ../config/m.h ../config/s.h \
 compatibility.h debugger.h misc.h mlvalues.h fix_code.h instruct.h \
 md5.h io.h memory.h gc.h major_gc.h freelist.h minor_gc.h reverse.h
compatibility.h debugger.h misc.h mlvalues.h fix_code.h instruct.h md5.h \
+ io.h memory.h gc.h major_gc.h freelist.h minor_gc.h reverse.h
 floats.o: floats.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h reverse.h stacks.h
+ ../config/s.h mlvalues.h fail.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h reverse.h stacks.h
 freelist.o: freelist.c config.h ../config/m.h ../config/s.h \
 compatibility.h freelist.h misc.h mlvalues.h gc.h gc_ctrl.h memory.h \
 major_gc.h minor_gc.h
+ compatibility.h freelist.h misc.h mlvalues.h gc.h gc_ctrl.h memory.h \
+ major_gc.h minor_gc.h
 gc_ctrl.o: gc_ctrl.c alloc.h compatibility.h misc.h config.h \
 ../config/m.h ../config/s.h mlvalues.h compact.h custom.h finalise.h \
 roots.h memory.h gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h \
 stacks.h
+ ../config/m.h ../config/s.h mlvalues.h compact.h custom.h finalise.h \
+ roots.h memory.h gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h \
+ stacks.h
 globroots.o: globroots.c memory.h compatibility.h config.h ../config/m.h \
 ../config/s.h gc.h mlvalues.h misc.h major_gc.h freelist.h minor_gc.h \
 roots.h globroots.h
+ ../config/s.h gc.h mlvalues.h misc.h major_gc.h freelist.h minor_gc.h \
+ roots.h globroots.h
 hash.o: hash.c mlvalues.h compatibility.h config.h ../config/m.h \
 ../config/s.h misc.h custom.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h
+ ../config/s.h misc.h custom.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h
 instrtrace.o: instrtrace.c
 intern.o: intern.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h custom.h fail.h gc.h intext.h io.h fix_code.h \
 memory.h major_gc.h freelist.h minor_gc.h reverse.h
+ ../config/s.h mlvalues.h custom.h fail.h gc.h intext.h io.h fix_code.h \
+ memory.h major_gc.h freelist.h minor_gc.h reverse.h
 interp.o: interp.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h backtrace.h callback.h debugger.h fail.h \
 fix_code.h instrtrace.h instruct.h interp.h major_gc.h freelist.h \
 memory.h gc.h minor_gc.h prims.h signals.h stacks.h jumptbl.h
+ ../config/s.h mlvalues.h backtrace.h callback.h debugger.h fail.h \
+ fix_code.h instrtrace.h instruct.h interp.h major_gc.h freelist.h \
+ memory.h gc.h minor_gc.h prims.h signals.h stacks.h jumptbl.h
 ints.o: ints.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h custom.h fail.h intext.h io.h fix_code.h \
 memory.h gc.h major_gc.h freelist.h minor_gc.h int64_native.h
+ ../config/s.h mlvalues.h custom.h fail.h intext.h io.h fix_code.h \
+ memory.h gc.h major_gc.h freelist.h minor_gc.h int64_native.h
 io.o: io.c config.h ../config/m.h ../config/s.h compatibility.h alloc.h \
 misc.h mlvalues.h custom.h fail.h io.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h signals.h sys.h
+ misc.h mlvalues.h custom.h fail.h io.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h signals.h sys.h
 lexing.o: lexing.c fail.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h stacks.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h
+ ../config/s.h mlvalues.h stacks.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h
 main.o: main.c misc.h compatibility.h config.h ../config/m.h \
 ../config/s.h mlvalues.h sys.h
+ ../config/s.h mlvalues.h sys.h
 major_gc.o: major_gc.c compact.h config.h ../config/m.h ../config/s.h \
 compatibility.h misc.h custom.h mlvalues.h fail.h finalise.h roots.h \
 memory.h gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h weak.h
+ compatibility.h misc.h custom.h mlvalues.h fail.h finalise.h roots.h \
+ memory.h gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h weak.h
 md5.o: md5.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h md5.h io.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h reverse.h
+ ../config/s.h mlvalues.h fail.h md5.h io.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h reverse.h
 memory.o: memory.c fail.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h freelist.h gc.h gc_ctrl.h major_gc.h memory.h \
 minor_gc.h signals.h
+ ../config/s.h mlvalues.h freelist.h gc.h gc_ctrl.h major_gc.h memory.h \
+ minor_gc.h signals.h
 meta.o: meta.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h fix_code.h interp.h intext.h io.h \
 major_gc.h freelist.h memory.h gc.h minor_gc.h prims.h stacks.h
+ ../config/s.h mlvalues.h fail.h fix_code.h interp.h intext.h io.h \
+ major_gc.h freelist.h memory.h gc.h minor_gc.h prims.h stacks.h
 minor_gc.o: minor_gc.c config.h ../config/m.h ../config/s.h \
 compatibility.h fail.h misc.h mlvalues.h finalise.h roots.h memory.h \
 gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h signals.h weak.h
+ compatibility.h fail.h misc.h mlvalues.h finalise.h roots.h memory.h \
+ gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h signals.h weak.h
 misc.o: misc.c config.h ../config/m.h ../config/s.h compatibility.h \
 misc.h memory.h gc.h mlvalues.h major_gc.h freelist.h minor_gc.h
+ misc.h memory.h gc.h mlvalues.h major_gc.h freelist.h minor_gc.h
 obj.o: obj.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h gc.h interp.h major_gc.h freelist.h \
 memory.h minor_gc.h prims.h
+ ../config/s.h mlvalues.h fail.h gc.h interp.h major_gc.h freelist.h \
+ memory.h minor_gc.h prims.h
 parsing.o: parsing.c config.h ../config/m.h ../config/s.h compatibility.h \
-  mlvalues.h misc.h memory.h gc.h major_gc.h freelist.h minor_gc.h \
-  alloc.h
+ mlvalues.h misc.h memory.h gc.h major_gc.h freelist.h minor_gc.h alloc.h
 prims.o: prims.c mlvalues.h compatibility.h config.h ../config/m.h \
 ../config/s.h misc.h prims.h
+ ../config/s.h misc.h prims.h
 printexc.o: printexc.c backtrace.h mlvalues.h compatibility.h config.h \
 ../config/m.h ../config/s.h misc.h callback.h debugger.h fail.h \
 printexc.h
+ ../config/m.h ../config/s.h misc.h callback.h debugger.h fail.h \
+ printexc.h
 roots.o: roots.c finalise.h roots.h misc.h compatibility.h config.h \
 ../config/m.h ../config/s.h memory.h gc.h mlvalues.h major_gc.h \
 freelist.h minor_gc.h globroots.h stacks.h
+ ../config/m.h ../config/s.h memory.h gc.h mlvalues.h major_gc.h \
+ freelist.h minor_gc.h globroots.h stacks.h
 signals.o: signals.c alloc.h compatibility.h misc.h config.h \
 ../config/m.h ../config/s.h mlvalues.h callback.h fail.h memory.h gc.h \
 major_gc.h freelist.h minor_gc.h roots.h signals.h signals_machdep.h \
 sys.h
+ ../config/m.h ../config/s.h mlvalues.h callback.h fail.h memory.h gc.h \
+ major_gc.h freelist.h minor_gc.h roots.h signals.h signals_machdep.h \
+ sys.h
 signals_byt.o: signals_byt.c config.h ../config/m.h ../config/s.h \
 compatibility.h memory.h gc.h mlvalues.h misc.h major_gc.h freelist.h \
 minor_gc.h osdeps.h signals.h signals_machdep.h
+ compatibility.h memory.h gc.h mlvalues.h misc.h major_gc.h freelist.h \
+ minor_gc.h osdeps.h signals.h signals_machdep.h
 stacks.o: stacks.c config.h ../config/m.h ../config/s.h compatibility.h \
 fail.h misc.h mlvalues.h stacks.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h
+ fail.h misc.h mlvalues.h stacks.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h
 startup.o: startup.c config.h ../config/m.h ../config/s.h compatibility.h \
 alloc.h misc.h mlvalues.h backtrace.h callback.h custom.h debugger.h \
 dynlink.h exec.h fail.h fix_code.h freelist.h gc_ctrl.h instrtrace.h \
 interp.h intext.h io.h memory.h gc.h major_gc.h minor_gc.h osdeps.h \
 prims.h printexc.h reverse.h signals.h stacks.h sys.h startup.h \
 version.h
+ alloc.h misc.h mlvalues.h backtrace.h callback.h custom.h debugger.h \
+ dynlink.h exec.h fail.h fix_code.h freelist.h gc_ctrl.h instrtrace.h \
+ interp.h intext.h io.h memory.h gc.h major_gc.h minor_gc.h osdeps.h \
+ prims.h printexc.h reverse.h signals.h stacks.h sys.h startup.h \
+ version.h
 str.o: str.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h
+ ../config/s.h mlvalues.h fail.h
 sys.o: sys.c config.h ../config/m.h ../config/s.h compatibility.h alloc.h \
 misc.h mlvalues.h debugger.h fail.h instruct.h osdeps.h signals.h \
 stacks.h memory.h gc.h major_gc.h freelist.h minor_gc.h sys.h
+ misc.h mlvalues.h debugger.h fail.h instruct.h osdeps.h signals.h \
+ stacks.h memory.h gc.h major_gc.h freelist.h minor_gc.h sys.h
 terminfo.o: terminfo.c config.h ../config/m.h ../config/s.h \
 compatibility.h alloc.h misc.h mlvalues.h fail.h io.h
+ compatibility.h alloc.h misc.h mlvalues.h fail.h io.h
 unix.o: unix.c config.h ../config/m.h ../config/s.h compatibility.h \
 memory.h gc.h mlvalues.h misc.h major_gc.h freelist.h minor_gc.h \
 osdeps.h
+ memory.h gc.h mlvalues.h misc.h major_gc.h freelist.h minor_gc.h \
+ osdeps.h
 weak.o: weak.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h major_gc.h freelist.h memory.h gc.h \
 minor_gc.h
+ ../config/s.h mlvalues.h fail.h major_gc.h freelist.h memory.h gc.h \
+ minor_gc.h
 alloc.d.o: alloc.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h custom.h major_gc.h freelist.h memory.h gc.h \
 minor_gc.h stacks.h
+ ../config/s.h mlvalues.h custom.h major_gc.h freelist.h memory.h gc.h \
+ minor_gc.h stacks.h
 array.d.o: array.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h
+ ../config/s.h mlvalues.h fail.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h
 backtrace.d.o: backtrace.c config.h ../config/m.h ../config/s.h \
 compatibility.h mlvalues.h misc.h alloc.h io.h instruct.h intext.h \
 fix_code.h exec.h memory.h gc.h major_gc.h freelist.h minor_gc.h \
 startup.h stacks.h sys.h backtrace.h
+ compatibility.h mlvalues.h misc.h alloc.h io.h instruct.h intext.h \
+ fix_code.h exec.h memory.h gc.h major_gc.h freelist.h minor_gc.h \
+ startup.h stacks.h sys.h backtrace.h
 callback.d.o: callback.c callback.h compatibility.h mlvalues.h config.h \
 ../config/m.h ../config/s.h misc.h fail.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h interp.h instruct.h fix_code.h stacks.h
+ ../config/m.h ../config/s.h misc.h fail.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h interp.h instruct.h fix_code.h stacks.h
 compact.d.o: compact.c config.h ../config/m.h ../config/s.h compatibility.h \
 finalise.h roots.h misc.h memory.h gc.h mlvalues.h major_gc.h \
 freelist.h minor_gc.h gc_ctrl.h weak.h
finalise.h roots.h misc.h memory.h gc.h mlvalues.h major_gc.h freelist.h \
+ minor_gc.h gc_ctrl.h weak.h
 compare.d.o: compare.c custom.h compatibility.h mlvalues.h config.h \
 ../config/m.h ../config/s.h misc.h fail.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h
+ ../config/m.h ../config/s.h misc.h fail.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h
 custom.d.o: custom.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h custom.h fail.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h
+ ../config/s.h mlvalues.h custom.h fail.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h
 debugger.d.o: debugger.c config.h ../config/m.h ../config/s.h \
 compatibility.h debugger.h misc.h mlvalues.h fail.h fix_code.h \
 instruct.h intext.h io.h stacks.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h sys.h
+ compatibility.h debugger.h misc.h mlvalues.h fail.h fix_code.h \
+ instruct.h intext.h io.h stacks.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h sys.h
 dynlink.d.o: dynlink.c config.h ../config/m.h ../config/s.h compatibility.h \
 alloc.h misc.h mlvalues.h dynlink.h fail.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h osdeps.h prims.h
+ alloc.h misc.h mlvalues.h dynlink.h fail.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h osdeps.h prims.h
 extern.d.o: extern.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h custom.h fail.h gc.h intext.h io.h fix_code.h \
 memory.h major_gc.h freelist.h minor_gc.h reverse.h
+ ../config/s.h mlvalues.h custom.h fail.h gc.h intext.h io.h fix_code.h \
+ memory.h major_gc.h freelist.h minor_gc.h reverse.h
 fail.d.o: fail.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h io.h gc.h memory.h major_gc.h \
 freelist.h minor_gc.h printexc.h signals.h stacks.h
../config/s.h mlvalues.h fail.h io.h gc.h memory.h major_gc.h freelist.h \
+ minor_gc.h printexc.h signals.h stacks.h
 finalise.d.o: finalise.c callback.h compatibility.h mlvalues.h config.h \
 ../config/m.h ../config/s.h misc.h fail.h roots.h memory.h gc.h \
 major_gc.h freelist.h minor_gc.h signals.h
+ ../config/m.h ../config/s.h misc.h fail.h roots.h memory.h gc.h \
+ major_gc.h freelist.h minor_gc.h signals.h
 fix_code.d.o: fix_code.c config.h ../config/m.h ../config/s.h \
 compatibility.h debugger.h misc.h mlvalues.h fix_code.h instruct.h \
 md5.h io.h memory.h gc.h major_gc.h freelist.h minor_gc.h reverse.h
compatibility.h debugger.h misc.h mlvalues.h fix_code.h instruct.h md5.h \
+ io.h memory.h gc.h major_gc.h freelist.h minor_gc.h reverse.h
 floats.d.o: floats.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h reverse.h stacks.h
+ ../config/s.h mlvalues.h fail.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h reverse.h stacks.h
 freelist.d.o: freelist.c config.h ../config/m.h ../config/s.h \
 compatibility.h freelist.h misc.h mlvalues.h gc.h gc_ctrl.h memory.h \
 major_gc.h minor_gc.h
+ compatibility.h freelist.h misc.h mlvalues.h gc.h gc_ctrl.h memory.h \
+ major_gc.h minor_gc.h
 gc_ctrl.d.o: gc_ctrl.c alloc.h compatibility.h misc.h config.h \
 ../config/m.h ../config/s.h mlvalues.h compact.h custom.h finalise.h \
 roots.h memory.h gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h \
 stacks.h
+ ../config/m.h ../config/s.h mlvalues.h compact.h custom.h finalise.h \
+ roots.h memory.h gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h \
+ stacks.h
 globroots.d.o: globroots.c memory.h compatibility.h config.h ../config/m.h \
 ../config/s.h gc.h mlvalues.h misc.h major_gc.h freelist.h minor_gc.h \
 roots.h globroots.h
+ ../config/s.h gc.h mlvalues.h misc.h major_gc.h freelist.h minor_gc.h \
+ roots.h globroots.h
 hash.d.o: hash.c mlvalues.h compatibility.h config.h ../config/m.h \
 ../config/s.h misc.h custom.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h
+ ../config/s.h misc.h custom.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h
 instrtrace.d.o: instrtrace.c instruct.h misc.h compatibility.h config.h \
 ../config/m.h ../config/s.h mlvalues.h opnames.h prims.h stacks.h \
 memory.h gc.h major_gc.h freelist.h minor_gc.h
+ ../config/m.h ../config/s.h mlvalues.h opnames.h prims.h stacks.h \
+ memory.h gc.h major_gc.h freelist.h minor_gc.h
 intern.d.o: intern.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h custom.h fail.h gc.h intext.h io.h fix_code.h \
 memory.h major_gc.h freelist.h minor_gc.h reverse.h
+ ../config/s.h mlvalues.h custom.h fail.h gc.h intext.h io.h fix_code.h \
+ memory.h major_gc.h freelist.h minor_gc.h reverse.h
 interp.d.o: interp.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h backtrace.h callback.h debugger.h fail.h \
 fix_code.h instrtrace.h instruct.h interp.h major_gc.h freelist.h \
 memory.h gc.h minor_gc.h prims.h signals.h stacks.h
+ ../config/s.h mlvalues.h backtrace.h callback.h debugger.h fail.h \
+ fix_code.h instrtrace.h instruct.h interp.h major_gc.h freelist.h \
+ memory.h gc.h minor_gc.h prims.h signals.h stacks.h
 ints.d.o: ints.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h custom.h fail.h intext.h io.h fix_code.h \
 memory.h gc.h major_gc.h freelist.h minor_gc.h int64_native.h
+ ../config/s.h mlvalues.h custom.h fail.h intext.h io.h fix_code.h \
+ memory.h gc.h major_gc.h freelist.h minor_gc.h int64_native.h
 io.d.o: io.c config.h ../config/m.h ../config/s.h compatibility.h alloc.h \
 misc.h mlvalues.h custom.h fail.h io.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h signals.h sys.h
+ misc.h mlvalues.h custom.h fail.h io.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h signals.h sys.h
 lexing.d.o: lexing.c fail.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h stacks.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h
+ ../config/s.h mlvalues.h stacks.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h
 main.d.o: main.c misc.h compatibility.h config.h ../config/m.h \
 ../config/s.h mlvalues.h sys.h
+ ../config/s.h mlvalues.h sys.h
 major_gc.d.o: major_gc.c compact.h config.h ../config/m.h ../config/s.h \
 compatibility.h misc.h custom.h mlvalues.h fail.h finalise.h roots.h \
 memory.h gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h weak.h
+ compatibility.h misc.h custom.h mlvalues.h fail.h finalise.h roots.h \
+ memory.h gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h weak.h
 md5.d.o: md5.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h md5.h io.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h reverse.h
+ ../config/s.h mlvalues.h fail.h md5.h io.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h reverse.h
 memory.d.o: memory.c fail.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h freelist.h gc.h gc_ctrl.h major_gc.h memory.h \
 minor_gc.h signals.h
+ ../config/s.h mlvalues.h freelist.h gc.h gc_ctrl.h major_gc.h memory.h \
+ minor_gc.h signals.h
 meta.d.o: meta.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h fix_code.h interp.h intext.h io.h \
 major_gc.h freelist.h memory.h gc.h minor_gc.h prims.h stacks.h
+ ../config/s.h mlvalues.h fail.h fix_code.h interp.h intext.h io.h \
+ major_gc.h freelist.h memory.h gc.h minor_gc.h prims.h stacks.h
 minor_gc.d.o: minor_gc.c config.h ../config/m.h ../config/s.h \
 compatibility.h fail.h misc.h mlvalues.h finalise.h roots.h memory.h \
 gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h signals.h weak.h
+ compatibility.h fail.h misc.h mlvalues.h finalise.h roots.h memory.h \
+ gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h signals.h weak.h
 misc.d.o: misc.c config.h ../config/m.h ../config/s.h compatibility.h \
 misc.h memory.h gc.h mlvalues.h major_gc.h freelist.h minor_gc.h
+ misc.h memory.h gc.h mlvalues.h major_gc.h freelist.h minor_gc.h
 obj.d.o: obj.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h gc.h interp.h major_gc.h freelist.h \
 memory.h minor_gc.h prims.h
+ ../config/s.h mlvalues.h fail.h gc.h interp.h major_gc.h freelist.h \
+ memory.h minor_gc.h prims.h
 parsing.d.o: parsing.c config.h ../config/m.h ../config/s.h compatibility.h \
-  mlvalues.h misc.h memory.h gc.h major_gc.h freelist.h minor_gc.h \
-  alloc.h
+ mlvalues.h misc.h memory.h gc.h major_gc.h freelist.h minor_gc.h alloc.h
 prims.d.o: prims.c mlvalues.h compatibility.h config.h ../config/m.h \
 ../config/s.h misc.h prims.h
+ ../config/s.h misc.h prims.h
 printexc.d.o: printexc.c backtrace.h mlvalues.h compatibility.h config.h \
 ../config/m.h ../config/s.h misc.h callback.h debugger.h fail.h \
 printexc.h
+ ../config/m.h ../config/s.h misc.h callback.h debugger.h fail.h \
+ printexc.h
 roots.d.o: roots.c finalise.h roots.h misc.h compatibility.h config.h \
 ../config/m.h ../config/s.h memory.h gc.h mlvalues.h major_gc.h \
 freelist.h minor_gc.h globroots.h stacks.h
+ ../config/m.h ../config/s.h memory.h gc.h mlvalues.h major_gc.h \
+ freelist.h minor_gc.h globroots.h stacks.h
 signals.d.o: signals.c alloc.h compatibility.h misc.h config.h \
 ../config/m.h ../config/s.h mlvalues.h callback.h fail.h memory.h gc.h \
 major_gc.h freelist.h minor_gc.h roots.h signals.h signals_machdep.h \
 sys.h
+ ../config/m.h ../config/s.h mlvalues.h callback.h fail.h memory.h gc.h \
+ major_gc.h freelist.h minor_gc.h roots.h signals.h signals_machdep.h \
+ sys.h
 signals_byt.d.o: signals_byt.c config.h ../config/m.h ../config/s.h \
 compatibility.h memory.h gc.h mlvalues.h misc.h major_gc.h freelist.h \
 minor_gc.h osdeps.h signals.h signals_machdep.h
+ compatibility.h memory.h gc.h mlvalues.h misc.h major_gc.h freelist.h \
+ minor_gc.h osdeps.h signals.h signals_machdep.h
 stacks.d.o: stacks.c config.h ../config/m.h ../config/s.h compatibility.h \
 fail.h misc.h mlvalues.h stacks.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h
+ fail.h misc.h mlvalues.h stacks.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h
 startup.d.o: startup.c config.h ../config/m.h ../config/s.h compatibility.h \
 alloc.h misc.h mlvalues.h backtrace.h callback.h custom.h debugger.h \
 dynlink.h exec.h fail.h fix_code.h freelist.h gc_ctrl.h instrtrace.h \
 interp.h intext.h io.h memory.h gc.h major_gc.h minor_gc.h osdeps.h \
 prims.h printexc.h reverse.h signals.h stacks.h sys.h startup.h \
 version.h
+ alloc.h misc.h mlvalues.h backtrace.h callback.h custom.h debugger.h \
+ dynlink.h exec.h fail.h fix_code.h freelist.h gc_ctrl.h instrtrace.h \
+ interp.h intext.h io.h memory.h gc.h major_gc.h minor_gc.h osdeps.h \
+ prims.h printexc.h reverse.h signals.h stacks.h sys.h startup.h \
+ version.h
 str.d.o: str.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h
+ ../config/s.h mlvalues.h fail.h
 sys.d.o: sys.c config.h ../config/m.h ../config/s.h compatibility.h alloc.h \
 misc.h mlvalues.h debugger.h fail.h instruct.h osdeps.h signals.h \
 stacks.h memory.h gc.h major_gc.h freelist.h minor_gc.h sys.h
+ misc.h mlvalues.h debugger.h fail.h instruct.h osdeps.h signals.h \
+ stacks.h memory.h gc.h major_gc.h freelist.h minor_gc.h sys.h
 terminfo.d.o: terminfo.c config.h ../config/m.h ../config/s.h \
 compatibility.h alloc.h misc.h mlvalues.h fail.h io.h
+ compatibility.h alloc.h misc.h mlvalues.h fail.h io.h
 unix.d.o: unix.c config.h ../config/m.h ../config/s.h compatibility.h \
 memory.h gc.h mlvalues.h misc.h major_gc.h freelist.h minor_gc.h \
 osdeps.h
+ memory.h gc.h mlvalues.h misc.h major_gc.h freelist.h minor_gc.h \
+ osdeps.h
 weak.d.o: weak.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h major_gc.h freelist.h memory.h gc.h \
 minor_gc.h
+ ../config/s.h mlvalues.h fail.h major_gc.h freelist.h memory.h gc.h \
+ minor_gc.h
 alloc.pic.o: alloc.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h custom.h major_gc.h freelist.h memory.h gc.h \
 minor_gc.h stacks.h
+ ../config/s.h mlvalues.h custom.h major_gc.h freelist.h memory.h gc.h \
+ minor_gc.h stacks.h
 array.pic.o: array.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h
+ ../config/s.h mlvalues.h fail.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h
 backtrace.pic.o: backtrace.c config.h ../config/m.h ../config/s.h \
 compatibility.h mlvalues.h misc.h alloc.h io.h instruct.h intext.h \
 fix_code.h exec.h memory.h gc.h major_gc.h freelist.h minor_gc.h \
 startup.h stacks.h sys.h backtrace.h
+ compatibility.h mlvalues.h misc.h alloc.h io.h instruct.h intext.h \
+ fix_code.h exec.h memory.h gc.h major_gc.h freelist.h minor_gc.h \
+ startup.h stacks.h sys.h backtrace.h
 callback.pic.o: callback.c callback.h compatibility.h mlvalues.h config.h \
 ../config/m.h ../config/s.h misc.h fail.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h interp.h instruct.h fix_code.h stacks.h
+ ../config/m.h ../config/s.h misc.h fail.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h interp.h instruct.h fix_code.h stacks.h
 compact.pic.o: compact.c config.h ../config/m.h ../config/s.h compatibility.h \
 finalise.h roots.h misc.h memory.h gc.h mlvalues.h major_gc.h \
 freelist.h minor_gc.h gc_ctrl.h weak.h
finalise.h roots.h misc.h memory.h gc.h mlvalues.h major_gc.h freelist.h \
+ minor_gc.h gc_ctrl.h weak.h
 compare.pic.o: compare.c custom.h compatibility.h mlvalues.h config.h \
 ../config/m.h ../config/s.h misc.h fail.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h
+ ../config/m.h ../config/s.h misc.h fail.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h
 custom.pic.o: custom.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h custom.h fail.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h
+ ../config/s.h mlvalues.h custom.h fail.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h
 debugger.pic.o: debugger.c config.h ../config/m.h ../config/s.h \
 compatibility.h debugger.h misc.h mlvalues.h fail.h fix_code.h \
 instruct.h intext.h io.h stacks.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h sys.h
+ compatibility.h debugger.h misc.h mlvalues.h fail.h fix_code.h \
+ instruct.h intext.h io.h stacks.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h sys.h
 dynlink.pic.o: dynlink.c config.h ../config/m.h ../config/s.h compatibility.h \
 alloc.h misc.h mlvalues.h dynlink.h fail.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h osdeps.h prims.h
+ alloc.h misc.h mlvalues.h dynlink.h fail.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h osdeps.h prims.h
 extern.pic.o: extern.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h custom.h fail.h gc.h intext.h io.h fix_code.h \
 memory.h major_gc.h freelist.h minor_gc.h reverse.h
+ ../config/s.h mlvalues.h custom.h fail.h gc.h intext.h io.h fix_code.h \
+ memory.h major_gc.h freelist.h minor_gc.h reverse.h
 fail.pic.o: fail.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h io.h gc.h memory.h major_gc.h \
 freelist.h minor_gc.h printexc.h signals.h stacks.h
../config/s.h mlvalues.h fail.h io.h gc.h memory.h major_gc.h freelist.h \
+ minor_gc.h printexc.h signals.h stacks.h
 finalise.pic.o: finalise.c callback.h compatibility.h mlvalues.h config.h \
 ../config/m.h ../config/s.h misc.h fail.h roots.h memory.h gc.h \
 major_gc.h freelist.h minor_gc.h signals.h
+ ../config/m.h ../config/s.h misc.h fail.h roots.h memory.h gc.h \
+ major_gc.h freelist.h minor_gc.h signals.h
 fix_code.pic.o: fix_code.c config.h ../config/m.h ../config/s.h \
 compatibility.h debugger.h misc.h mlvalues.h fix_code.h instruct.h \
 md5.h io.h memory.h gc.h major_gc.h freelist.h minor_gc.h reverse.h
compatibility.h debugger.h misc.h mlvalues.h fix_code.h instruct.h md5.h \
+ io.h memory.h gc.h major_gc.h freelist.h minor_gc.h reverse.h
 floats.pic.o: floats.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h reverse.h stacks.h
+ ../config/s.h mlvalues.h fail.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h reverse.h stacks.h
 freelist.pic.o: freelist.c config.h ../config/m.h ../config/s.h \
 compatibility.h freelist.h misc.h mlvalues.h gc.h gc_ctrl.h memory.h \
 major_gc.h minor_gc.h
+ compatibility.h freelist.h misc.h mlvalues.h gc.h gc_ctrl.h memory.h \
+ major_gc.h minor_gc.h
 gc_ctrl.pic.o: gc_ctrl.c alloc.h compatibility.h misc.h config.h \
 ../config/m.h ../config/s.h mlvalues.h compact.h custom.h finalise.h \
 roots.h memory.h gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h \
 stacks.h
+ ../config/m.h ../config/s.h mlvalues.h compact.h custom.h finalise.h \
+ roots.h memory.h gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h \
+ stacks.h
 globroots.pic.o: globroots.c memory.h compatibility.h config.h ../config/m.h \
 ../config/s.h gc.h mlvalues.h misc.h major_gc.h freelist.h minor_gc.h \
 roots.h globroots.h
+ ../config/s.h gc.h mlvalues.h misc.h major_gc.h freelist.h minor_gc.h \
+ roots.h globroots.h
 hash.pic.o: hash.c mlvalues.h compatibility.h config.h ../config/m.h \
 ../config/s.h misc.h custom.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h
+ ../config/s.h misc.h custom.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h
 instrtrace.pic.o: instrtrace.c
 intern.pic.o: intern.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h custom.h fail.h gc.h intext.h io.h fix_code.h \
 memory.h major_gc.h freelist.h minor_gc.h reverse.h
+ ../config/s.h mlvalues.h custom.h fail.h gc.h intext.h io.h fix_code.h \
+ memory.h major_gc.h freelist.h minor_gc.h reverse.h
 interp.pic.o: interp.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h backtrace.h callback.h debugger.h fail.h \
 fix_code.h instrtrace.h instruct.h interp.h major_gc.h freelist.h \
 memory.h gc.h minor_gc.h prims.h signals.h stacks.h jumptbl.h
+ ../config/s.h mlvalues.h backtrace.h callback.h debugger.h fail.h \
+ fix_code.h instrtrace.h instruct.h interp.h major_gc.h freelist.h \
+ memory.h gc.h minor_gc.h prims.h signals.h stacks.h jumptbl.h
 ints.pic.o: ints.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h custom.h fail.h intext.h io.h fix_code.h \
 memory.h gc.h major_gc.h freelist.h minor_gc.h int64_native.h
+ ../config/s.h mlvalues.h custom.h fail.h intext.h io.h fix_code.h \
+ memory.h gc.h major_gc.h freelist.h minor_gc.h int64_native.h
 io.pic.o: io.c config.h ../config/m.h ../config/s.h compatibility.h alloc.h \
 misc.h mlvalues.h custom.h fail.h io.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h signals.h sys.h
+ misc.h mlvalues.h custom.h fail.h io.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h signals.h sys.h
 lexing.pic.o: lexing.c fail.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h stacks.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h
+ ../config/s.h mlvalues.h stacks.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h
 main.pic.o: main.c misc.h compatibility.h config.h ../config/m.h \
 ../config/s.h mlvalues.h sys.h
+ ../config/s.h mlvalues.h sys.h
 major_gc.pic.o: major_gc.c compact.h config.h ../config/m.h ../config/s.h \
 compatibility.h misc.h custom.h mlvalues.h fail.h finalise.h roots.h \
 memory.h gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h weak.h
+ compatibility.h misc.h custom.h mlvalues.h fail.h finalise.h roots.h \
+ memory.h gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h weak.h
 md5.pic.o: md5.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h md5.h io.h memory.h gc.h major_gc.h \
 freelist.h minor_gc.h reverse.h
+ ../config/s.h mlvalues.h fail.h md5.h io.h memory.h gc.h major_gc.h \
+ freelist.h minor_gc.h reverse.h
 memory.pic.o: memory.c fail.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h freelist.h gc.h gc_ctrl.h major_gc.h memory.h \
 minor_gc.h signals.h
+ ../config/s.h mlvalues.h freelist.h gc.h gc_ctrl.h major_gc.h memory.h \
+ minor_gc.h signals.h
 meta.pic.o: meta.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h fix_code.h interp.h intext.h io.h \
 major_gc.h freelist.h memory.h gc.h minor_gc.h prims.h stacks.h
+ ../config/s.h mlvalues.h fail.h fix_code.h interp.h intext.h io.h \
+ major_gc.h freelist.h memory.h gc.h minor_gc.h prims.h stacks.h
 minor_gc.pic.o: minor_gc.c config.h ../config/m.h ../config/s.h \
 compatibility.h fail.h misc.h mlvalues.h finalise.h roots.h memory.h \
 gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h signals.h weak.h
+ compatibility.h fail.h misc.h mlvalues.h finalise.h roots.h memory.h \
+ gc.h major_gc.h freelist.h minor_gc.h gc_ctrl.h signals.h weak.h
 misc.pic.o: misc.c config.h ../config/m.h ../config/s.h compatibility.h \
 misc.h memory.h gc.h mlvalues.h major_gc.h freelist.h minor_gc.h
+ misc.h memory.h gc.h mlvalues.h major_gc.h freelist.h minor_gc.h
 obj.pic.o: obj.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h gc.h interp.h major_gc.h freelist.h \
 memory.h minor_gc.h prims.h
+ ../config/s.h mlvalues.h fail.h gc.h interp.h major_gc.h freelist.h \
+ memory.h minor_gc.h prims.h
 parsing.pic.o: parsing.c config.h ../config/m.h ../config/s.h compatibility.h \
-  mlvalues.h misc.h memory.h gc.h major_gc.h freelist.h minor_gc.h \
-  alloc.h
+ mlvalues.h misc.h memory.h gc.h major_gc.h freelist.h minor_gc.h alloc.h
 prims.pic.o: prims.c mlvalues.h compatibility.h config.h ../config/m.h \
 ../config/s.h misc.h prims.h
+ ../config/s.h misc.h prims.h
 printexc.pic.o: printexc.c backtrace.h mlvalues.h compatibility.h config.h \
 ../config/m.h ../config/s.h misc.h callback.h debugger.h fail.h \
 printexc.h
+ ../config/m.h ../config/s.h misc.h callback.h debugger.h fail.h \
+ printexc.h
 roots.pic.o: roots.c finalise.h roots.h misc.h compatibility.h config.h \
 ../config/m.h ../config/s.h memory.h gc.h mlvalues.h major_gc.h \
 freelist.h minor_gc.h globroots.h stacks.h
+ ../config/m.h ../config/s.h memory.h gc.h mlvalues.h major_gc.h \
+ freelist.h minor_gc.h globroots.h stacks.h
 signals.pic.o: signals.c alloc.h compatibility.h misc.h config.h \
 ../config/m.h ../config/s.h mlvalues.h callback.h fail.h memory.h gc.h \
 major_gc.h freelist.h minor_gc.h roots.h signals.h signals_machdep.h \
 sys.h
+ ../config/m.h ../config/s.h mlvalues.h callback.h fail.h memory.h gc.h \
+ major_gc.h freelist.h minor_gc.h roots.h signals.h signals_machdep.h \
+ sys.h
 signals_byt.pic.o: signals_byt.c config.h ../config/m.h ../config/s.h \
 compatibility.h memory.h gc.h mlvalues.h misc.h major_gc.h freelist.h \
 minor_gc.h osdeps.h signals.h signals_machdep.h
+ compatibility.h memory.h gc.h mlvalues.h misc.h major_gc.h freelist.h \
+ minor_gc.h osdeps.h signals.h signals_machdep.h
 stacks.pic.o: stacks.c config.h ../config/m.h ../config/s.h compatibility.h \
 fail.h misc.h mlvalues.h stacks.h memory.h gc.h major_gc.h freelist.h \
 minor_gc.h
+ fail.h misc.h mlvalues.h stacks.h memory.h gc.h major_gc.h freelist.h \
+ minor_gc.h
 startup.pic.o: startup.c config.h ../config/m.h ../config/s.h compatibility.h \
 alloc.h misc.h mlvalues.h backtrace.h callback.h custom.h debugger.h \
 dynlink.h exec.h fail.h fix_code.h freelist.h gc_ctrl.h instrtrace.h \
 interp.h intext.h io.h memory.h gc.h major_gc.h minor_gc.h osdeps.h \
 prims.h printexc.h reverse.h signals.h stacks.h sys.h startup.h \
 version.h
+ alloc.h misc.h mlvalues.h backtrace.h callback.h custom.h debugger.h \
+ dynlink.h exec.h fail.h fix_code.h freelist.h gc_ctrl.h instrtrace.h \
+ interp.h intext.h io.h memory.h gc.h major_gc.h minor_gc.h osdeps.h \
+ prims.h printexc.h reverse.h signals.h stacks.h sys.h startup.h \
+ version.h
 str.pic.o: str.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h
+ ../config/s.h mlvalues.h fail.h
 sys.pic.o: sys.c config.h ../config/m.h ../config/s.h compatibility.h alloc.h \
 misc.h mlvalues.h debugger.h fail.h instruct.h osdeps.h signals.h \
 stacks.h memory.h gc.h major_gc.h freelist.h minor_gc.h sys.h
+ misc.h mlvalues.h debugger.h fail.h instruct.h osdeps.h signals.h \
+ stacks.h memory.h gc.h major_gc.h freelist.h minor_gc.h sys.h
 terminfo.pic.o: terminfo.c config.h ../config/m.h ../config/s.h \
 compatibility.h alloc.h misc.h mlvalues.h fail.h io.h
+ compatibility.h alloc.h misc.h mlvalues.h fail.h io.h
 unix.pic.o: unix.c config.h ../config/m.h ../config/s.h compatibility.h \
 memory.h gc.h mlvalues.h misc.h major_gc.h freelist.h minor_gc.h \
 osdeps.h
+ memory.h gc.h mlvalues.h misc.h major_gc.h freelist.h minor_gc.h \
+ osdeps.h
 weak.pic.o: weak.c alloc.h compatibility.h misc.h config.h ../config/m.h \
 ../config/s.h mlvalues.h fail.h major_gc.h freelist.h memory.h gc.h \
 minor_gc.h
+ ../config/s.h mlvalues.h fail.h major_gc.h freelist.h memory.h gc.h \
+ minor_gc.h
index 3639c43bbb25078bbfc2548b70ee33ea46ac065c..f9689126a650ec38b60463ef353666cf4e03b29b 100644 (file)
@@ -13,7 +13,7 @@
 
 /* $Id$ */
 
-/* Interface with the debugger */
+/* Interface with the byte-code debugger */
 
 #ifdef _WIN32
 #include <io.h>
 
 #include "config.h"
 #include "debugger.h"
-#include "fail.h"
-#include "fix_code.h"
-#include "instruct.h"
-#include "intext.h"
-#include "io.h"
 #include "misc.h"
-#include "mlvalues.h"
-#include "stacks.h"
-#include "sys.h"
 
 int caml_debugger_in_use = 0;
 uintnat caml_event_count;
+int caml_debugger_fork_mode = 1; /* parent by default */
 
-#if !defined(HAS_SOCKETS)
+#if !defined(HAS_SOCKETS) || defined(NATIVE_CODE)
 
 void caml_debugger_init(void)
 {
@@ -46,6 +39,10 @@ void caml_debugger(enum event_kind event)
 {
 }
 
+void caml_debugger_cleanup_fork(void)
+{
+}
+
 #else
 
 #ifdef HAS_UNISTD
@@ -67,6 +64,15 @@ void caml_debugger(enum event_kind event)
 #include <process.h>
 #endif
 
+#include "fail.h"
+#include "fix_code.h"
+#include "instruct.h"
+#include "intext.h"
+#include "io.h"
+#include "mlvalues.h"
+#include "stacks.h"
+#include "sys.h"
+
 static int sock_domain;         /* Socket domain for the debugger */
 static union {                  /* Socket address for the debugger */
   struct sockaddr s_gen;
@@ -109,7 +115,7 @@ static void open_connection(void)
 #endif
   if (dbg_socket == -1 ||
       connect(dbg_socket, &sock_addr.s_gen, sock_addr_len) == -1){
-    caml_fatal_error_arg2 ("cannot connect to debugger at %s", dbg_addr,
+    caml_fatal_error_arg2 ("cannot connect to debugger at %s\n", dbg_addr,
                            "error: %s\n", strerror (errno));
   }
 #ifdef _WIN32
@@ -412,8 +418,19 @@ void caml_debugger(enum event_kind event)
       caml_putword(dbg_out, (Code_val(val)-caml_start_code) * sizeof(opcode_t));
       caml_flush(dbg_out);
       break;
+    case REQ_SET_FORK_MODE:
+      caml_debugger_fork_mode = caml_getword(dbg_in);
+      break;
     }
   }
 }
 
+void caml_debugger_cleanup_fork(void)
+{
+  /* We could remove all of the breakpoints, but closing the connection
+   * means that they'll just be skipped anyway. */
+  close_connection();
+  caml_debugger_in_use = 0;
+}
+
 #endif
index ce479d271a6dfece151df656758c8e44393a2357..57a58f1c6da96bf5ba868fae782db58aabd13fb2 100644 (file)
@@ -21,8 +21,8 @@
 #include "misc.h"
 #include "mlvalues.h"
 
-extern int caml_debugger_in_use;
-extern int running;
+CAMLextern int caml_debugger_in_use;
+CAMLextern int caml_debugger_fork_mode; /* non-zero for parent */
 extern uintnat caml_event_count;
 
 enum event_kind {
@@ -32,6 +32,7 @@ enum event_kind {
 
 void caml_debugger_init (void);
 void caml_debugger (enum event_kind event);
+void caml_debugger_cleanup_fork (void);
 
 /* Communication protocol */
 
@@ -84,9 +85,11 @@ enum debugger_request {
   REQ_MARSHAL_OBJ = 'M',        /* mlvalue v */
   /* Send a copy of the data structure rooted at v, using the same
      format as [caml_output_value]. */
-  REQ_GET_CLOSURE_CODE = 'C'    /* mlvalue v */
+  REQ_GET_CLOSURE_CODE = 'C',   /* mlvalue v */
   /* Send the code address of the given closure.
      Reply is one uint32. */
+  REQ_SET_FORK_MODE = 'K'       /* uint32 m */
+  /* Set whether to follow the child (m=0) or the parent on fork. */
 };
 
 /* Replies to a REQ_GO request. All replies are followed by three uint32:
index 6851558108d9b230e7d4ccb66237bfc95abfd02e..bc7996d550f384563435bed0467a542c70e928ed 100644 (file)
@@ -122,6 +122,7 @@ static int running_finalisation_function = 0;
 void caml_final_do_calls (void)
 {
   struct final f;
+  value res;
 
   if (running_finalisation_function) return;
 
@@ -139,8 +140,9 @@ void caml_final_do_calls (void)
       -- to_do_hd->size;
       f = to_do_hd->item[to_do_hd->size];
       running_finalisation_function = 1;
-      caml_callback (f.fun, f.val + f.offset);   /* FIXME PR#4742 */
+      res = caml_callback_exn (f.fun, f.val + f.offset);
       running_finalisation_function = 0;
+      if (Is_exception_result (res)) caml_raise (Extract_exception (res));
     }
     caml_gc_message (0x80, "Done calling finalisation functions.\n", 0);
   }
index 0083f3673492c960f4ba19dabf417eace4d7c8ce..0fe2215155be25f31c4b1d873b766eb27eda651f 100644 (file)
 #include "minor_gc.h"
 #include "misc.h"
 #include "mlvalues.h"
+#ifdef NATIVE_CODE
+#include "stack.h"
+#else
 #include "stacks.h"
+#endif
 
 #ifndef NATIVE_CODE
 extern uintnat caml_max_stack_size;    /* defined in stacks.c */
@@ -214,7 +218,7 @@ static value heap_stats (int returnstats)
     intnat cpct = caml_stat_compactions;
     intnat top_heap_words = Wsize_bsize (caml_stat_top_heap_size);
 
-    res = caml_alloc_tuple (15);
+    res = caml_alloc_tuple (16);
     Store_field (res, 0, caml_copy_double (minwords));
     Store_field (res, 1, caml_copy_double (prowords));
     Store_field (res, 2, caml_copy_double (majwords));
@@ -230,6 +234,7 @@ static value heap_stats (int returnstats)
     Store_field (res, 12, Val_long (fragments));
     Store_field (res, 13, Val_long (cpct));
     Store_field (res, 14, Val_long (top_heap_words));
+    Store_field (res, 15, Val_long (caml_stack_usage()));
     CAMLreturn (res);
   }else{
     CAMLreturn (Val_unit);
@@ -266,7 +271,7 @@ CAMLprim value caml_gc_quick_stat(value v)
   intnat cpct = caml_stat_compactions;
   intnat heap_chunks = caml_stat_heap_chunks;
 
-  res = caml_alloc_tuple (15);
+  res = caml_alloc_tuple (16);
   Store_field (res, 0, caml_copy_double (minwords));
   Store_field (res, 1, caml_copy_double (prowords));
   Store_field (res, 2, caml_copy_double (majwords));
@@ -282,6 +287,7 @@ CAMLprim value caml_gc_quick_stat(value v)
   Store_field (res, 12, Val_long (0));
   Store_field (res, 13, Val_long (cpct));
   Store_field (res, 14, Val_long (top_heap_words));
+  Store_field (res, 15, Val_long (caml_stack_usage()));
   CAMLreturn (res);
 }
 
index 44d1f293cd8c2d898d3abed78c613b49997a5ad9..e7c7f048529308aca36c105d5debd40dee0a6efd 100644 (file)
@@ -494,19 +494,30 @@ CAMLprim value caml_channel_descriptor(value vchannel)
 CAMLprim value caml_ml_close_channel(value vchannel)
 {
   int result;
+  int do_syscall;
+  int fd;
 
   /* For output channels, must have flushed before */
   struct channel * channel = Channel(vchannel);
   if (channel->fd != -1){
-    result = close(channel->fd);
+    fd = channel->fd;
     channel->fd = -1;
+    do_syscall = 1;
   }else{
+    do_syscall = 0;
     result = 0;
   }
   /* Ensure that every read or write on the channel will cause an
      immediate caml_flush_partial or caml_refill, thus raising a Sys_error
      exception */
   channel->curr = channel->max = channel->end;
+
+  if (do_syscall) {
+    caml_enter_blocking_section();
+    result = close(fd);
+    caml_leave_blocking_section();
+  }
+
   if (result == -1) caml_sys_error (NO_ARG);
   return Val_unit;
 }
index f43a4423086c99752d14e751f52ed6e6eb19e37b..f2de29f09ce646e7d0e9690f25e02abd153d0f41 100644 (file)
@@ -102,3 +102,14 @@ void caml_change_max_stack_size (uintnat new_max_size)
   }
   caml_max_stack_size = new_max_size;
 }
+
+CAMLexport uintnat (*caml_stack_usage_hook)(void) = NULL;
+
+uintnat caml_stack_usage(void)
+{
+  uintnat sz;
+  sz = caml_stack_high - caml_extern_sp;
+  if (caml_stack_usage_hook != NULL)
+    sz += (*caml_stack_usage_hook)();
+  return sz;
+}
index 0c23a0a3984bb583db3bd5ad6c1946014f098179..48e8acc9c55bd61a6f6ef5341181c76534df7abb 100644 (file)
@@ -36,6 +36,8 @@ CAMLextern value * caml_trap_barrier;
 void caml_init_stack (uintnat init_max_size);
 void caml_realloc_stack (asize_t required_size);
 void caml_change_max_stack_size (uintnat new_max_size);
+uintnat caml_stack_usage (void);
 
+CAMLextern uintnat (*caml_stack_usage_hook)(void);
 
 #endif /* CAML_STACKS_H */
diff --git a/camlp4/.vcs b/camlp4/.vcs
deleted file mode 100644 (file)
index 70f4211..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
----
-exclude:
-  - !re boot/camlp4boot\.save\..*
-  - build/camlp4_config.ml
index 19b5053b8676255031bff358ceb0f3bcc6268c93..4ed2fb9946376c8d7241910ed8bf8c38a7c8f4b4 100644 (file)
       (* `s *)
     | ExVrn of loc and string
       (* while e do { e } *)
-    | ExWhi of loc and expr and expr ]
+    | ExWhi of loc and expr and expr
+      (* let open i in e *)
+    | ExOpI of loc and ident and expr ]
   and module_type =
     [ MtNil of loc
       (* i *) (* A.B.C *)
index b3641718cbad0513616d111572836514a16ceb1b..b47d4555eda895d2c121c18ff5ebd497d57600e3 100644 (file)
@@ -456,6 +456,9 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
         | _ ->
             pp f "@[<hv0>@[<2>let %a%a@]@ @[<hv2>in@ %a@]@]"
               o#rec_flag r o#binding bi o#reset_semi#expr e ]
+    | <:expr< let open $i$ in $e$ >> ->
+        pp f "@[<2>let open %a@]@ @[<2>in@ %a@]"
+             o#ident i o#reset_semi#expr e
     | <:expr< match $e$ with [ $a$ ] >> ->
         pp f "@[<hv0>@[<hv0>@[<2>match %a@]@ with@]%a@]"
           o#expr e o#match_case a
@@ -549,6 +552,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
       <:expr< if $_$ then $_$ else $_$ >> |
       <:expr< let $rec:_$ $_$ in $_$ >> |
       <:expr< let module $_$ = $_$ in $_$ >> |
+      <:expr< let open $_$ in $_$ >> |
       <:expr< assert $_$ >> | <:expr< assert False >> |
       <:expr< lazy $_$ >> | <:expr< new $_$ >> |
       <:expr< object ($_$) $_$ end >> ->
index dc5192bf030601f64eac87eb3bc69b6a4fcfa293..8354935d6aff674fa36199fa3f2fa93429679246 100644 (file)
@@ -490,7 +490,11 @@ module Make (Ast : Sig.Camlp4Ast) = struct
             mkrangepat loc c1 c2
         | _ -> error loc "range pattern allowed only for characters" ]
     | PaRec loc p ->
-        mkpat loc (Ppat_record (List.map mklabpat (list_of_patt p []), Closed))
+        let ps = list_of_patt p [] in
+        let is_wildcard = fun [ <:patt< _ >> -> True | _ -> False ] in
+        let (wildcards,ps) = List.partition is_wildcard ps in
+        let is_closed = if wildcards = [] then Closed else Open in
+        mkpat loc (Ppat_record (List.map mklabpat ps, is_closed))
     | PaStr loc s ->
         mkpat loc (Ppat_constant (Const_string (string_of_string_token loc s)))
     | <:patt@loc< ($p1$, $p2$) >> ->
@@ -731,6 +735,8 @@ module Make (Ast : Sig.Camlp4Ast) = struct
     | ExWhi loc e1 el ->
         let e2 = ExSeq loc el in
         mkexp loc (Pexp_while (expr e1) (expr e2))
+    | <:expr@loc< let open $i$ in $e$ >> ->
+        mkexp loc (Pexp_open (long_uident i) (expr e))
     | <:expr@loc< $_$,$_$ >> -> error loc "expr, expr: not allowed here"
     | <:expr@loc< $_$;$_$ >> ->
         error loc "expr; expr: not allowed here, use do {...} or [|...|] to surround them"
index fa550bacf4871dc6c42c11455b5ece0bb67f37cb..2bedf9aa110023127e78e455c2ff068b6d9f3e99 100644 (file)
@@ -115,13 +115,15 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
         | _ -> 1 ])
   ;
 
-  value test_label_eq =
-    Gram.Entry.of_parser "test_label_eq"
+  value test_label_expr_list =
+    Gram.Entry.of_parser "test_label_expr_list"
       (test 1 where rec test lev strm =
         match stream_peek_nth lev strm with
         [ Some (UIDENT _ | LIDENT _ | KEYWORD ".") ->
             test (lev + 1) strm
-        | Some (KEYWORD "=") -> ()
+        | Some (KEYWORD ("="|";"|"}")) ->
+            (* ";" and "}" occur due to record punning *)
+            ()
         | _ -> raise Stream.Failure ])
   ;
 
@@ -178,6 +180,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
   DELETE_RULE Gram meth_list: meth_decl; opt_dot_dot END;
   DELETE_RULE Gram expr: "let"; opt_rec; binding; "in"; SELF END;
   DELETE_RULE Gram expr: "let"; "module"; a_UIDENT; module_binding0; "in"; SELF END;
+  DELETE_RULE Gram expr: "let"; "open"; module_longident; "in"; SELF END;
   DELETE_RULE Gram expr: "fun"; "["; LIST0 match_case0 SEP "|"; "]" END;
   DELETE_RULE Gram expr: "if"; SELF; "then"; SELF; "else"; SELF END;
   DELETE_RULE Gram expr: "do"; do_sequence END;
@@ -284,6 +287,8 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
               | _ -> <:str_item< value $rec:r$ $bi$ >> ]
           | "let"; "module"; m = a_UIDENT; mb = module_binding0; "in"; e = expr ->
               <:str_item< let module $m$ = $mb$ in $e$ >>
+          | "let"; "open"; i = module_longident; "in"; e = expr ->
+              <:str_item< let open $id:i$ in $e$ >>
       ] ]
     ;
     seq_expr:
@@ -300,6 +305,8 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
         | "let"; "module"; m = a_UIDENT; mb = module_binding0; "in";
           e = expr LEVEL ";" ->
             <:expr< let module $m$ = $mb$ in $e$ >>
+        | "let"; "open"; i = module_longident; "in"; e = expr LEVEL ";" ->
+            <:expr< let open $id:i$ in $e$ >>
         | "function"; a = match_case ->
             <:expr< fun [ $a$ ] >>
         | "if"; e1 = SELF; "then"; e2 = expr LEVEL "top";
@@ -335,7 +342,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
     expr: LEVEL "simple" (* LEFTA *)
       [ [ "false" -> <:expr< False >>
         | "true" -> <:expr< True >>
-        | "{"; test_label_eq; lel = label_expr_list; "}" ->
+        | "{"; test_label_expr_list; lel = label_expr_list; "}" ->
             <:expr< { $lel$ } >>
         | "{"; e = expr LEVEL "."; "with"; lel = label_expr_list; "}" ->
             <:expr< { ($e$) with $lel$ } >>
index 9dab8bd74797fe23d2c05d7b5f7037e3b3ba9dc9..f31636e22c02f23eec382a4911f87ad64f1eb6ae 100644 (file)
@@ -255,6 +255,12 @@ Very old (no more supported) syntax:\n\
     | e -> e ]
   ;
 
+  value rec lid_of_ident =
+    fun
+    [ <:ident< $_$ . $i$ >> -> lid_of_ident i
+    | <:ident< $lid:lid$ >> -> lid
+    | _                     -> assert False ];
+
   value module_type_app mt1 mt2 =
     match (mt1, mt2) with
     [ (<:module_type@_loc< $id:i1$ >>, <:module_type< $id:i2$ >>) ->
@@ -598,6 +604,8 @@ Very old (no more supported) syntax:\n\
             <:expr< let $rec:r$ $bi$ in $x$ >>
         | "let"; "module"; m = a_UIDENT; mb = module_binding0; "in"; e = SELF ->
             <:expr< let module $m$ = $mb$ in $e$ >>
+        | "let"; "open"; i = module_longident; "in"; e = SELF ->
+            <:expr< let open $id:i$ in $e$ >>
         | "fun"; "["; a = LIST0 match_case0 SEP "|"; "]" ->
             <:expr< fun [ $list:a$ ] >>
         | "fun"; e = fun_def -> e
@@ -754,6 +762,8 @@ Very old (no more supported) syntax:\n\
             k <:expr< let module $m$ = $mb$ in $e$ >>
         | "let"; "module"; m = a_UIDENT; mb = module_binding0; ";"; el = SELF ->
             <:expr< let module $m$ = $mb$ in $mksequence _loc el$ >>
+        | "let"; "open"; i = module_longident; "in"; e = SELF ->
+            <:expr< let open $id:i$ in $e$ >>
         | `ANTIQUOT ("list" as n) s -> <:expr< $anti:mk_anti ~c:"expr;" n s$ >>
         | e = expr; k = sequence' -> k e ] ]
     ;
@@ -819,7 +829,9 @@ Very old (no more supported) syntax:\n\
             <:rec_binding< $anti:mk_anti ~c:"ident" n s$ = $e$ >>
         | `ANTIQUOT ("list" as n) s ->
             <:rec_binding< $anti:mk_anti ~c:"rec_binding" n s$ >>
-        | i = label_longident; e = fun_binding -> <:rec_binding< $i$ = $e$ >> ] ]
+        | i = label_longident; e = fun_binding -> <:rec_binding< $i$ = $e$ >>
+        | i = label_longident ->
+            <:rec_binding< $i$ = $lid:lid_of_ident i$ >> ] ]
     ;
     fun_def:
       [ [ p = labeled_ipatt; (w, e) = fun_def_cont ->
@@ -909,6 +921,8 @@ Very old (no more supported) syntax:\n\
     ;
     label_patt_list:
       [ [ p1 = label_patt; ";"; p2 = SELF -> <:patt< $p1$ ; $p2$ >>
+        | p1 = label_patt; ";"; "_"       -> <:patt< $p1$ ; _ >>
+        | p1 = label_patt; ";"; "_"; ";"  -> <:patt< $p1$ ; _ >>
         | p1 = label_patt; ";"            -> p1
         | p1 = label_patt                 -> p1
       ] ];
@@ -919,6 +933,7 @@ Very old (no more supported) syntax:\n\
         | `ANTIQUOT ("list" as n) s ->
             <:patt< $anti:mk_anti ~c:"patt;" n s$ >>
         | i = label_longident; "="; p = patt -> <:patt< $i$ = $p$ >>
+        | i = label_longident -> <:patt< $i$ = $lid:lid_of_ident i$ >>
       ] ]
     ;
     ipatt:
diff --git a/camlp4/Makefile b/camlp4/Makefile
deleted file mode 100644 (file)
index 8686e25..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-#########################################################################
-#                                                                       #
-#                            Objective Caml                             #
-#                                                                       #
-#        Nicolas Pouillard, projet Gallium, INRIA Rocquencourt          #
-#                                                                       #
-#   Copyright 2006 Institut National de Recherche en Informatique et    #
-#   en Automatique.  All rights reserved.  This file is distributed     #
-#   under the terms of the Q Public License version 1.0.                #
-#                                                                       #
-#########################################################################
-
-
-
-# RELEASE NOTE:
-#   Do not forget to call make genclean to update Makefile.clean before a
-#   release.
-
-OCAMLC=../boot/ocamlrun ../ocamlc -nostdlib \
-  -I ../stdlib -I ../otherlibs/unix -I ../otherlibs/win32unix -I build -g
-OCAMLRUN=../boot/ocamlrun -I ../otherlibs/unix -I ../otherlibs/win32unix
-YAM=$(OCAMLRUN) ./yam
-YAM_OPTIONS=-verbosity '$(VERBOSE)'
-
-default: all
-
-opt install doc all pack just_doc: yam
-       @echo 'YAM $@ (use "make $@ VERBOSE=1" for a verbose make)'
-       @$(YAM) $(YAM_OPTIONS) $@
-
-smartclean::
-       if test -x ../boot/ocamlrun; then \
-         if test -x ../ocaml; then \
-           $(OCAML) build/build.ml -clean; \
-         else \
-           if test -x ./yam; then \
-             $(YAM) $(YAM_OPTIONS) -clean; \
-           else \
-             $(MAKE) staticclean; \
-           fi; \
-         fi; \
-       else \
-         rm -f $(CLEANFILES); \
-       fi
-
-genclean: yam
-       $(YAM) -genclean Makefile.clean
-       (echo /Camlp4Ast.ml/d; echo w; echo q) | ed Makefile.clean
-
-clean::
-       rm -f yam .cache-status
-       rm -f $(CLEANFILES)
-       rm -f *.cm[io] build/*.cm[io]
-
-YAM_OBJS=build/YaM.cmo build/camlp4_config.cmo Makefile.cmo
-
-yam: $(YAM_OBJS)
-       $(OCAMLC) -o yam unix.cma $(YAM_OBJS)
-
-.SUFFIXES: .mli .ml .cmi .cmo
-
-.mli.cmi:
-       $(OCAMLC) -c $*.mli
-.ml.cmo:
-       $(OCAMLC) -c $*.ml
-
-build/YaM.cmo: build/YaM.cmi
-Makefile.cmo: build/YaM.cmi build/camlp4_config.cmo
-
-uninstall:
-       rm -rf "$(LIBDIR)/camlp4"
-       cd "$(BINDIR)"; rm -f *camlp4*
-
-depend:
-
-# Normal bootstrap
-
-bootstrap: backup promote clean all compare
-bootstrap-debug: backup promote-debug clean all compare
-
-backup restore boot-clean::
-       cd boot && $(MAKE) $@
-
-promote-debug:
-       cp camlp4boot-debug.run boot/camlp4boot
-
-promote:
-       cp camlp4boot.run boot/camlp4boot
-
-compare:
-       @if (cmp camlp4boot.run boot/camlp4boot); \
-       then echo "Fixpoint reached, bootstrap succeeded."; \
-       else echo "Fixpoint not reached, try one more bootstrapping cycle."; \
-       fi
-
-.PHONY: clean install all uninstall backup restore boot-clean promote-debug \
-       promote compare opt doc smartclean depend
-
-include Makefile.clean
diff --git a/camlp4/Makefile.ml b/camlp4/Makefile.ml
deleted file mode 100644 (file)
index eefedf1..0000000
+++ /dev/null
@@ -1,358 +0,0 @@
-(****************************************************************************)
-(*                                                                          *)
-(*                              Objective Caml                              *)
-(*                                                                          *)
-(*                            INRIA Rocquencourt                            *)
-(*                                                                          *)
-(*  Copyright  2006   Institut National de Recherche  en  Informatique et   *)
-(*  en Automatique.  All rights reserved.  This file is distributed under   *)
-(*  the terms of the GNU Library General Public License, with the special   *)
-(*  exception on linking described in LICENSE at the top of the Objective   *)
-(*  Caml source tree.                                                       *)
-(*                                                                          *)
-(****************************************************************************)
-
-(* Authors:
- * - Nicolas Pouillard: initial version
- *)
-open YaM
-open Format
-
-let getenv var default =
-  try Sys.getenv var
-  with Not_found ->
-    default
-
-let libdir_camlp4 = (getenv "LIBDIR" Camlp4_config.libdir) ^ "/camlp4/."
-
-let bindir = (getenv "BINDIR" Camlp4_config.bindir) ^ "/."
-
-(**
-let unixlib =
-  match Sys.os_type with
-  | "Win32" -> "../otherlibs/win32unix"
-  | _       -> "../otherlibs/unix"
-**)
-let ocamlrun = "../boot/ocamlrun" (* " -I " ^ unixlib *)
-let ocamlrun_os =
-  Filename.concat Filename.parent_dir_name
-                  (Filename.concat "boot" "ocamlrun")
-(*  ^ " -I " ^ unixlib *)
-
-let ocaml = ocamlrun ^ " ../ocaml -I ../stdlib" (* "-I " ^ unixlib *)
-
-let debug_mode =
-  (* true *)
-  false
-
-let camlp4_modules =
-  [
-    ocamlrun_os;
-    "./boot/camlp4boot";
-  ]
-let camlp4_modules =
-  if debug_mode then "env STATIC_CAMLP4_DEBUG=\\*" :: camlp4_modules
-  else camlp4_modules
-
-let debug_opt x = if debug_mode && Sys.file_exists x then [x] else []
-let filter_opt x = if Sys.file_exists x then [x] else []
-
-let camlp4boot = "'" ^ String.concat " " camlp4_modules ^ "'"
-let camlp4boot_may_debug mods =
-  let camlp4_modules = camlp4_modules @
-    debug_opt "./boot/ExceptionTracer.cmo" @
-    filter_opt "./boot/Profiler.cmo" @ mods
-  in "'" ^ String.concat " " camlp4_modules ^ "'"
-
-let ocamlc =
-  best ["../ocamlc.opt", "../ocamlc.opt";
-        "../ocamlc",     ocamlrun ^^ "../ocamlc";
-        "",              "echo no byte compiler available && false"]
-let ocamlopt =
-  best ["../ocamlopt.opt", "../ocamlopt.opt";
-        "../ocamlopt",     ocamlrun ^^ "../ocamlopt";
-        "",                "echo no native compiler available && false"]
-
-let () =
-  !options.ocamlc       := ocamlc ^^ " -nostdlib -I ../stdlib";
-  !options.ocamlopt     := ocamlopt ^^ " -nostdlib -I ../stdlib";
-  !options.ocamldoc     := ocamlrun ^^ "../ocamldoc/ocamldoc";
-  !options.ocamlyacc    := ocamlrun ^^ "../boot/ocamlyacc";
-  !options.ocamllex     := ocamlrun ^^ "../boot/ocamllex";
-  !options.ocamldep     := ocamlrun ^^ "../tools/ocamldep";
-  ()
-
-let options_without_camlp4 = new_scope (lazy !options)
-
-let windows = Sys.os_type = "Win32"
-
-let may_define_unix = if windows then [] else ["-D UNIX"]
-
-let () =
-  !options.ocaml_Flags ^= "-w Aler -warn-error Aler"^^
-                            (if getenv "DTYPES" "" <> "" then "-annot"
-                             else "");
-  !options.ocaml_P4     := camlp4boot_may_debug may_define_unix;
-  !options.ocaml_P4_opt := camlp4boot_may_debug ("-D OPT" :: may_define_unix);
-  ()
-
-let options_without_debug () = { (!options) with ocaml_P4     = ref camlp4boot
-                                               ; ocaml_P4_opt = ref camlp4boot }
-
-let parsing = "../parsing"
-and typing = "../typing"
-and toplevel = "../toplevel"
-and utils = "../utils"
-and dynlink = "../otherlibs/dynlink"
-and unix =
-  match Sys.os_type with
-  | "Win32" -> "../otherlibs/win32unix"
-  | _       -> "../otherlibs/unix"
-and build = "build"
-
-let ocaml_Module_with_genmap =
-  generic_ocaml_Module_extension ".genmap.ml"
-   (fun _ i o ->
-      "if test ! -e"^^o^^
-         "|| ( test -e ./camlp4boot.run"^^
-             "&& test -e Camlp4Filters/GenerateMap.cmo"^^
-             "&& test -e Camlp4Filters/GenerateFold.cmo"^^
-             "&& test -e Camlp4Filters/MetaGenerator.cmo"^^
-             "&& test -e Camlp4Filters/RemoveTrashModule.cmo ) ;"^^
-      "then ( echo 'module Camlp4FiltersTrash = struct' ;"^^
-             "cat Camlp4/Sig/Camlp4Ast.ml ; echo 'end;' ) > Camlp4/Struct/Camlp4Ast.tmp.ml ;"^^
-             "( echo '(* Generated file! Do not edit by hand *)' ;"^^
-                "../boot/ocamlrun ./camlp4boot.run"^^
-                   "./Camlp4Filters/GenerateMap.cmo"^^
-                   "./Camlp4Filters/GenerateFold.cmo"^^
-                   "./Camlp4Filters/MetaGenerator.cmo"^^
-                   "./Camlp4Filters/RemoveTrashModule.cmo -printer OCamlr"^^
-                   i^^" -no_comments ) >"^^o^^"; else : ; fi")
-
-let camlp4_package_as_one_dir =
-  ocaml_PackageDir "Camlp4" (lazy [
-    ocaml_IModule ~includes:[build] "Config";
-    ocaml_IModule ~o:(options_without_debug ()) "Debug";
-    ocaml_IModule "Options";
-    ocaml_PackageDir "Sig" (lazy [
-      ocaml_Interface "Id";
-      ocaml_Interface ~ext_includes:[parsing] "Loc";
-      ocaml_Interface "Error";
-      ocaml_Interface "Warning";
-      ocaml_Interface "Type";
-      ocaml_Interface "Token";
-      ocaml_Interface "Lexer";
-      ocaml_PackageDir "Grammar" (lazy [
-        ocaml_Interface "Action";
-        ocaml_Interface "Structure";
-        ocaml_Interface "Dynamic";
-        ocaml_Interface "Static"
-      ]);
-      ocaml_IModule "Mapper";
-      ocaml_Interface "Ast";
-      ocaml_Module "Camlp4Ast";
-      ocaml_Interface "Quotation";
-      ocaml_Interface "Camlp4Token";
-      ocaml_Interface "DynLoader";
-      ocaml_Interface "AntiquotSyntax";
-      ocaml_Interface "Parser";
-      ocaml_Interface "Printer";
-      ocaml_Interface "Syntax";
-      ocaml_Interface "Camlp4Syntax";
-      ocaml_Interface "AstFilters";
-      ocaml_Interface "SyntaxExtension";
-    ]);
-    ocaml_IModule "ErrorHandler";
-    ocaml_PackageDir "Struct" (lazy [
-      ocaml_IModule ~ext_includes:[parsing] "Loc";
-      ocaml_Module  "Warning";
-      ocaml_IModule "EmptyError";
-      ocaml_IModule "EmptyPrinter";
-      ocaml_IModule "Token";
-      ocaml_Lexer ~includes:[utils] ~ext_includes:[parsing] ~pp:"" "Lexer";
-      ocaml_PackageDir "Grammar" (lazy [
-        ocaml_Module "Context";
-        ocaml_Module "Structure";
-        ocaml_Module "Search";
-        ocaml_Module "Tools";
-        ocaml_IModule "Print";
-        ocaml_Module "Failed";
-        ocaml_Module "Parser";
-        ocaml_IModule "Fold";
-        ocaml_Module "Insert";
-        ocaml_Module "Delete";
-        ocaml_Module "Entry";
-        ocaml_Module "Find";
-        ocaml_Module "Dynamic";
-        ocaml_Module "Static"
-      ]);
-      ocaml_Module "Quotation";
-      ocaml_IModule ~ext_includes:[dynlink] "DynLoader";
-      ocaml_Module_with_genmap ~flags:"-w z -warn-error z" "Camlp4Ast";
-      ocaml_IModule "FreeVars";
-      ocaml_Module "AstFilters";
-      ocaml_IModule ~ext_includes:[parsing] "Camlp4Ast2OCamlAst";
-      ocaml_Module "CleanAst";
-      ocaml_IModule "CommentFilter";
-    ]);
-    ocaml_Module "OCamlInitSyntax";
-    ocaml_PackageDir "Printers" (lazy [
-      ocaml_IModule "Null";
-      ocaml_IModule "DumpOCamlAst";
-      ocaml_IModule "DumpCamlp4Ast";
-      ocaml_IModule "OCaml";
-      ocaml_IModule "OCamlr" ~flags:"-w v -warn-error v";
-      (* ocaml_IModule "OCamlrr"; *)
-    ]);
-    ocaml_IModule "PreCast";
-    ocaml_IModule "Register"
-  ])
-
-let camlp4_parsers =
-  ocaml_PackageDir "Camlp4Parsers" (lazy [
-    ocaml_Module "OCamlr";
-    ocaml_Module "OCaml";
-    (* ocaml_Module "OCamlrr"; *)
-    ocaml_Module "OCamlQuotationBase";
-    ocaml_Module "OCamlQuotation";
-    ocaml_Module "OCamlRevisedQuotation";
-    ocaml_Module "OCamlOriginalQuotation";
-    ocaml_Module "OCamlRevisedParser";
-    ocaml_Module "OCamlParser";
-    ocaml_Module "Grammar";
-    ocaml_Module "Macro";
-    ocaml_Module ~o:(options_without_debug ()) "Debug";
-    ocaml_Module "LoadCamlp4Ast";
-  ])
-
-let camlp4_printers =
-  ocaml_PackageDir "Camlp4Printers" (lazy [
-    ocaml_Module "DumpOCamlAst";
-    ocaml_Module "DumpCamlp4Ast";
-    ocaml_Module "OCaml";
-    ocaml_Module "OCamlr";
-    (* ocaml_Module "OCamlrr"; *)
-    ocaml_Module "Null";
-    ocaml_Module ~ext_includes:[unix] "Auto";
-  ])
-
-let camlp4_filters =
-  ocaml_PackageDir "Camlp4Filters" (lazy [
-    ocaml_Module "ExceptionTracer";
-    ocaml_Module "Tracer";
-    ocaml_Module "StripLocations";
-    ocaml_Module "LiftCamlp4Ast";
-    ocaml_Module "GenerateMap";
-    ocaml_Module "GenerateFold";
-    ocaml_Module "MetaGenerator";
-    ocaml_Module "RemoveTrashModule";
-    ocaml_Module "Profiler";
-  ])
-
-let camlp4_top =
-  ocaml_PackageDir "Camlp4Top" (lazy [
-    ocaml_Module ~ext_includes:[toplevel; typing; parsing] "Rprint";
-    ocaml_Module ~ext_includes:[toplevel; parsing; utils] "Camlp4Top";
-  ])
-
-let split c s =
-  let rec self acc s =
-    try
-      let pos = String.rindex s c in
-      let x = String.sub s 0 pos
-      and y = String.sub s (pos + 1) (String.length s - pos - 1)
-      in self (y :: acc) x
-    with Not_found -> s :: acc
-  in self [] s
-let chop_end c s =
-  let pos = String.rindex s c in
-  String.sub s (pos + 1) (String.length s - pos - 1)
-let file ppf f =
-  let cin = open_in f in
-  let rec loop () =
-    pp_print_string ppf (input_line cin);
-    fprintf ppf "@\n";
-    loop ()
-  in try loop () with End_of_file -> ()
-let ext_split f = split '.' f
-
-
-let print_packed_sources ppf ?(skip = fun _ -> false) package_dir =
-  let _ =
-  fold_units_sources [package_dir] (fun name sources k (skip, inside) ->
-    eprintf "%s: [%s] (%b)@." name (String.concat "; " sources) inside;
-    let name = try chop_end '/' name with Not_found -> name in
-    let k () = ignore (k (skip, true)) in
-    if not inside then k () else (
-      if skip name then fprintf ppf "(**/**)@\n" else fprintf ppf "(** *)@\n";
-      fprintf ppf "@[<2>module %s " name;
-      let (mli, ml, mll, k) =
-        List.fold_right
-          (fun x (mli, ml, mll, k) ->
-            match ext_split x with
-            | [_; "mli"] -> (Some x, ml, mll, k)
-            | [_; "ml"]  -> (mli, Some x, mll, k)
-            | [_; "mll"] -> (mli, ml, Some x, k)
-            | [x; "meta"; "ml"] -> (mli, Some (x^".ml"), mll, fun () -> ())
-            | [x; "genmap"; "ml"] -> (mli, Some (x^".ml"), mll, fun () -> ())
-            | [_; ext] -> failwith ("unknown extension " ^ ext)
-            | _ -> failwith ("bad file "^x))
-          sources (None, None, None, k) in
-      (match (ml, mll, mli) with
-      | (None, None, Some mli) -> fprintf ppf "=@ @[<2>struct@\n"
-      | (_, _, Some mli) -> fprintf ppf ":@,@[<2>sig@\n%a@]@\nend@\n" file mli;
-                            fprintf ppf "=@ @[<2>struct@\n"
-      | _ -> fprintf ppf "=@ @[<2>struct@\n");
-      (match (ml, mll, mli) with
-      | (_, Some mll, _) ->
-            fprintf ppf "(*___CAMLP4_LEXER___ %a ___CAMLP4_LEXER___*)@\n();"
-            file (String.sub mll 0 (String.length mll - 1))
-      | (Some ml, _, _) -> k (); fprintf ppf "%a" file ml
-      | (None, _, Some mli) -> k (); fprintf ppf "%a" file mli
-      | _ -> if sources <> [] then () else k ());
-      fprintf ppf "@]@\nend;@]@\n";
-      if skip name then fprintf ppf "(**/**)@\n";
-    );
-    (skip, inside)
-  ) (skip, false) in fprintf ppf "@."
-
-let run l =
-  let cmd = String.concat " " l in
-  let () = Format.printf "%s@." cmd in
-  let st = YaM.call cmd in
-  if st <> 0 then failwith ("Exit: " ^ string_of_int st)
-
-let sed re str file =
-  run ["sed"; "-i"; "-e"; "'s/"^re^"/"^str^"/'"; file]
-
-let pack () =
-  let revised_to_ocaml f =
-    run ["./boot/camlp4boot -printer OCaml -o "^f^".ml -impl "^f^".ml4"] in
-  let ppf_of_file f = formatter_of_out_channel (open_out f) in
-  let skip_struct = function "Struct" -> true | _ -> false in
-  print_packed_sources (ppf_of_file "Camlp4.ml4")
-                       ~skip:skip_struct camlp4_package_as_one_dir;
-  print_packed_sources (ppf_of_file "Camlp4Parsers.ml4") camlp4_parsers;
-  print_packed_sources (ppf_of_file "Camlp4Printers.ml4") camlp4_printers;
-  print_packed_sources (ppf_of_file "Camlp4Filters.ml4") camlp4_filters;
-  print_packed_sources (ppf_of_file "Camlp4Top.ml4") camlp4_top;
-  revised_to_ocaml "Camlp4";
-  sed "(\\*___CAMLP4_LEXER___" "" "Camlp4.ml";
-  sed "___CAMLP4_LEXER___\\*)" "" "Camlp4.ml";
-  sed "^ *# [0-9]\\+.*$" "" "Camlp4.ml";
-  revised_to_ocaml "Camlp4Parsers";
-  revised_to_ocaml "Camlp4Printers";
-  revised_to_ocaml "Camlp4Filters";
-  revised_to_ocaml "Camlp4Top"
-
-let just_doc () =
-  run ["cd doc && ../../ocamldoc/ocamldoc";
-       "-v -short-functors -html";
-       "-I ../../parsing -I ../build -I ../../utils -I ..";
-       "-dump ocamldoc.out";
-       "-t 'Camlp4 a Pre-Processor-Pretty-Printer for Objective Caml'";
-       "../Camlp4.ml"; "../Camlp4Parsers.ml"; "../Camlp4Printers.ml";
-       "../Camlp4Filters.ml"; "../Camlp4Top.ml"]
-
-let doc () =
-  pack (); just_doc ()
index b2ae399febb2ac3dcbeac5da947e43a78fda80d7..fa03d37ca3205953f93734df162f216b0664ab0b 100644 (file)
@@ -640,7 +640,7 @@ module Sig =
         (** {6 Traversals} *)
         (** This class is the base class for map traversal on the Ast.
       To make a custom traversal class one just extend it like that:
-      
+
       This example swap pairs expression contents:
       open Camlp4.PreCast;
       [class swap = object
@@ -1046,6 +1046,8 @@ module Sig =
           ExVrn of loc * string
           | (* while e do { e } *)
           ExWhi of loc * expr * expr
+          | (* let open i in e *)
+          ExOpI of loc * ident * expr
           and module_type =
           | MtNil of loc
           | (* i *)
@@ -1821,6 +1823,7 @@ module Sig =
           | ExTyc of loc * expr * ctyp
           | ExVrn of loc * string
           | ExWhi of loc * expr * expr
+          | ExOpI of loc * ident * expr
           and module_type =
           | MtNil of loc
           | MtId of loc * ident
@@ -8064,6 +8067,17 @@ module Struct =
                                 meta_loc _loc x0)
                         and meta_expr _loc =
                           function
+                          | Ast.ExOpI (x0, x1, x2) ->
+                              Ast.ExApp (_loc,
+                                Ast.ExApp (_loc,
+                                  Ast.ExApp (_loc,
+                                    Ast.ExId (_loc,
+                                      Ast.IdAcc (_loc,
+                                        Ast.IdUid (_loc, "Ast"),
+                                        Ast.IdUid (_loc, "ExOpI"))),
+                                    meta_loc _loc x0),
+                                  meta_ident _loc x1),
+                                meta_expr _loc x2)
                           | Ast.ExWhi (x0, x1, x2) ->
                               Ast.ExApp (_loc,
                                 Ast.ExApp (_loc,
@@ -10103,6 +10117,17 @@ module Struct =
                                 meta_loc _loc x0)
                         and meta_expr _loc =
                           function
+                          | Ast.ExOpI (x0, x1, x2) ->
+                              Ast.PaApp (_loc,
+                                Ast.PaApp (_loc,
+                                  Ast.PaApp (_loc,
+                                    Ast.PaId (_loc,
+                                      Ast.IdAcc (_loc,
+                                        Ast.IdUid (_loc, "Ast"),
+                                        Ast.IdUid (_loc, "ExOpI"))),
+                                    meta_loc _loc x0),
+                                  meta_ident _loc x1),
+                                meta_expr _loc x2)
                           | Ast.ExWhi (x0, x1, x2) ->
                               Ast.PaApp (_loc,
                                 Ast.PaApp (_loc,
@@ -11950,6 +11975,10 @@ module Struct =
                       let _x = o#loc _x in
                       let _x_i1 = o#expr _x_i1 in
                       let _x_i2 = o#expr _x_i2 in ExWhi (_x, _x_i1, _x_i2)
+                  | ExOpI (_x, _x_i1, _x_i2) ->
+                      let _x = o#loc _x in
+                      let _x_i1 = o#ident _x_i1 in
+                      let _x_i2 = o#expr _x_i2 in ExOpI (_x, _x_i1, _x_i2)
                   
                 method ctyp : ctyp -> ctyp =
                   function
@@ -12715,6 +12744,9 @@ module Struct =
                   | ExWhi (_x, _x_i1, _x_i2) ->
                       let o = o#loc _x in
                       let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
+                  | ExOpI (_x, _x_i1, _x_i2) ->
+                      let o = o#loc _x in
+                      let o = o#ident _x_i1 in let o = o#expr _x_i2 in o
                   
                 method ctyp : ctyp -> 'self_type =
                   function
@@ -13889,8 +13921,14 @@ module Struct =
                    | _ ->
                        error loc "range pattern allowed only for characters")
               | PaRec (loc, p) ->
-                  mkpat loc
-                    (Ppat_record (List.map mklabpat (list_of_patt p []), Closed))
+                  let ps = list_of_patt p [] in
+                  let is_wildcard =
+                    (function | Ast.PaAny _ -> true | _ -> false) in
+                  let (wildcards, ps) = List.partition is_wildcard ps in
+                  let is_closed = if wildcards = [] then Closed else Open
+                  in
+                    mkpat loc
+                      (Ppat_record (((List.map mklabpat ps), is_closed)))
               | PaStr (loc, s) ->
                   mkpat loc
                     (Ppat_constant
@@ -14189,6 +14227,8 @@ module Struct =
               | ExWhi (loc, e1, el) ->
                   let e2 = ExSeq (loc, el)
                   in mkexp loc (Pexp_while (expr e1, expr e2))
+              | Ast.ExOpI (loc, i, e) ->
+                  mkexp loc (Pexp_open (long_uident i, expr e))
               | Ast.ExCom (loc, _, _) ->
                   error loc "expr, expr: not allowed here"
               | Ast.ExSem (loc, _, _) ->
@@ -14539,7 +14579,8 @@ module Struct =
                   (Pcf_cstr (((ctyp t1), (ctyp t2), (mkloc loc)))) :: l
               | Ast.CrSem (_, cst1, cst2) ->
                   class_str_item cst1 (class_str_item cst2 l)
-              | CrInh (_, ce, "") -> (Pcf_inher (Fresh, class_expr ce, None)) :: l
+              | CrInh (_, ce, "") ->
+                  (Pcf_inher (Fresh, class_expr ce, None)) :: l
               | CrInh (_, ce, pb) ->
                   (Pcf_inher (Fresh, class_expr ce, Some pb)) :: l
               | CrIni (_, e) -> (Pcf_init (expr e)) :: l
@@ -14549,9 +14590,12 @@ module Struct =
                      | Ast.TyNil _ -> None
                      | t -> Some (mkpolytype (ctyp t))) in
                   let e = mkexp loc (Pexp_poly (expr e, t))
-                  in (Pcf_meth ((s, (mkprivate b), Fresh, e, (mkloc loc)))) :: l
+                  in
+                    (Pcf_meth ((s, (mkprivate b), Fresh, e, (mkloc loc)))) ::
+                      l
               | CrVal (loc, s, b, e) ->
-                  (Pcf_val ((s, (mkmutable b), Fresh, (expr e), (mkloc loc)))) :: l
+                  (Pcf_val ((s, (mkmutable b), Fresh, (expr e), (mkloc loc)))) ::
+                    l
               | CrVir (loc, s, b, t) ->
                   (Pcf_virt
                      ((s, (mkprivate b), (mkpolytype (ctyp t)), (mkloc loc)))) ::
@@ -18404,6 +18448,9 @@ module Printers =
                                  "@[<hv0>@[<2>let %a%a@]@ @[<hv2>in@ %a@]@]"
                                  o#rec_flag r o#binding bi o#reset_semi#expr
                                  e)
+                      | Ast.ExOpI (_, i, e) ->
+                          pp f "@[<2>let open %a@]@ @[<2>in@ %a@]" o#ident i
+                            o#reset_semi#expr e
                       | Ast.ExMat (_, e, a) ->
                           pp f "@[<hv0>@[<hv0>@[<2>match %a@]@ with@]%a@]"
                             o#expr e o#match_case a
@@ -18518,9 +18565,9 @@ module Printers =
                           Ast.ExFun (_, _) | Ast.ExMat (_, _, _) |
                           Ast.ExTry (_, _, _) | Ast.ExIfe (_, _, _, _) |
                           Ast.ExLet (_, _, _, _) | Ast.ExLmd (_, _, _, _) |
-                          Ast.ExAsr (_, _) | Ast.ExAsf _ | Ast.ExLaz (_, _) |
-                          Ast.ExNew (_, _) | Ast.ExObj (_, _, _) ->
-                          pp f "(%a)" o#reset#expr e
+                          Ast.ExOpI (_, _, _) | Ast.ExAsr (_, _) |
+                          Ast.ExAsf _ | Ast.ExLaz (_, _) | Ast.ExNew (_, _) |
+                          Ast.ExObj (_, _, _) -> pp f "(%a)" o#reset#expr e
                   
                 method direction_flag =
                   fun f b ->
@@ -19410,7 +19457,11 @@ module Printers =
                           pp f "@[<2>%a@ when@ %a@ ->@ %a@]" o#patt p
                             o#under_pipe#expr w o#under_pipe#expr e
                   
-                method sum_type = fun f t -> pp f "@[<hv0>[ %a ]@]" o#ctyp t
+                method sum_type =
+                  fun f ->
+                    function
+                    | Ast.TyNil _ -> pp f "[]"
+                    | t -> pp f "@[<hv0>[ %a ]@]" o#ctyp t
                   
                 method ident =
                   fun f i ->
index 68ce6da48afda6273afb35189b956824305b3769..d7af05e7447755225b17046b8c4ee90acc8d165e 100644 (file)
@@ -1180,7 +1180,17 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
                         (meta_loc _loc x0) ]
                 and meta_expr _loc =
                   fun
-                  [ Ast.ExWhi x0 x1 x2 ->
+                  [ Ast.ExOpI x0 x1 x2 ->
+                      Ast.ExApp _loc
+                        (Ast.ExApp _loc
+                           (Ast.ExApp _loc
+                              (Ast.ExId _loc
+                                 (Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
+                                    (Ast.IdUid _loc "ExOpI")))
+                              (meta_loc _loc x0))
+                           (meta_ident _loc x1))
+                        (meta_expr _loc x2)
+                  | Ast.ExWhi x0 x1 x2 ->
                       Ast.ExApp _loc
                         (Ast.ExApp _loc
                            (Ast.ExApp _loc
@@ -3100,7 +3110,17 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
                         (meta_loc _loc x0) ]
                 and meta_expr _loc =
                   fun
-                  [ Ast.ExWhi x0 x1 x2 ->
+                  [ Ast.ExOpI x0 x1 x2 ->
+                      Ast.PaApp _loc
+                        (Ast.PaApp _loc
+                           (Ast.PaApp _loc
+                              (Ast.PaId _loc
+                                 (Ast.IdAcc _loc (Ast.IdUid _loc "Ast")
+                                    (Ast.IdUid _loc "ExOpI")))
+                              (meta_loc _loc x0))
+                           (meta_ident _loc x1))
+                        (meta_expr _loc x2)
+                  | Ast.ExWhi x0 x1 x2 ->
                       Ast.PaApp _loc
                         (Ast.PaApp _loc
                            (Ast.PaApp _loc
@@ -4817,7 +4837,11 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
           | ExWhi _x _x_i1 _x_i2 ->
               let _x = o#loc _x in
               let _x_i1 = o#expr _x_i1 in
-              let _x_i2 = o#expr _x_i2 in ExWhi _x _x_i1 _x_i2 ];
+              let _x_i2 = o#expr _x_i2 in ExWhi _x _x_i1 _x_i2
+          | ExOpI _x _x_i1 _x_i2 ->
+              let _x = o#loc _x in
+              let _x_i1 = o#ident _x_i1 in
+              let _x_i2 = o#expr _x_i2 in ExOpI _x _x_i1 _x_i2 ];
         method ctyp : ctyp -> ctyp =
           fun
           [ TyNil _x -> let _x = o#loc _x in TyNil _x
@@ -5457,7 +5481,10 @@ module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
           | ExVrn _x _x_i1 -> let o = o#loc _x in let o = o#string _x_i1 in o
           | ExWhi _x _x_i1 _x_i2 ->
               let o = o#loc _x in
-              let o = o#expr _x_i1 in let o = o#expr _x_i2 in o ];
+              let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
+          | ExOpI _x _x_i1 _x_i2 ->
+              let o = o#loc _x in
+              let o = o#ident _x_i1 in let o = o#expr _x_i2 in o ];
         method ctyp : ctyp -> 'self_type =
           fun
           [ TyNil _x -> let o = o#loc _x in o
index 8b5537a54e93ad1f430b7a24721eb273681e16fd..d84dc53bc361e86a44ca5ae93c16bb11d8014cd9 100644 (file)
@@ -415,6 +415,12 @@ Very old (no more supported) syntax:\n\
           | (Ast.ExSem (_, _, _) as e) -> Ast.ExSeq (_loc, e)
           | e -> e
           
+        let rec lid_of_ident =
+          function
+          | Ast.IdAcc (_, _, i) -> lid_of_ident i
+          | Ast.IdLid (_, lid) -> lid
+          | _ -> assert false
+          
         let module_type_app mt1 mt2 =
           match (mt1, mt2) with
           | (Ast.MtId (_loc, i1), Ast.MtId (_, i2)) ->
@@ -1874,6 +1880,16 @@ Very old (no more supported) syntax:\n\
                                 (_loc : Gram.Loc.t) ->
                                 (Ast.ExFun (_loc, Ast.mcOr_of_list a) :
                                   'expr))));
+                         ([ Gram.Skeyword "let"; Gram.Skeyword "open";
+                            Gram.Snterm
+                              (Gram.Entry.obj
+                                 (module_longident :
+                                   'module_longident Gram.Entry.t));
+                            Gram.Skeyword "in"; Gram.Sself ],
+                          (Gram.Action.mk
+                             (fun (e : 'expr) _ (i : 'module_longident) _ _
+                                (_loc : Gram.Loc.t) ->
+                                (Ast.ExOpI (_loc, i, e) : 'expr))));
                          ([ Gram.Skeyword "let"; Gram.Skeyword "module";
                             Gram.Snterm
                               (Gram.Entry.obj
@@ -2671,6 +2687,16 @@ Very old (no more supported) syntax:\n\
                                        mk_anti ~c: "expr;" n s) :
                                       'sequence)
                                 | _ -> assert false)));
+                         ([ Gram.Skeyword "let"; Gram.Skeyword "open";
+                            Gram.Snterm
+                              (Gram.Entry.obj
+                                 (module_longident :
+                                   'module_longident Gram.Entry.t));
+                            Gram.Skeyword "in"; Gram.Sself ],
+                          (Gram.Action.mk
+                             (fun (e : 'sequence) _ (i : 'module_longident) _
+                                _ (_loc : Gram.Loc.t) ->
+                                (Ast.ExOpI (_loc, i, e) : 'sequence))));
                          ([ Gram.Skeyword "let"; Gram.Skeyword "module";
                             Gram.Snterm
                               (Gram.Entry.obj
@@ -3041,6 +3067,17 @@ Very old (no more supported) syntax:\n\
                    (None,
                     [ (None, None,
                        [ ([ Gram.Snterm
+                              (Gram.Entry.obj
+                                 (label_longident :
+                                   'label_longident Gram.Entry.t)) ],
+                          (Gram.Action.mk
+                             (fun (i : 'label_longident) (_loc : Gram.Loc.t)
+                                ->
+                                (Ast.RbEq (_loc, i,
+                                   Ast.ExId (_loc,
+                                     Ast.IdLid (_loc, lid_of_ident i))) :
+                                  'label_expr))));
+                         ([ Gram.Snterm
                               (Gram.Entry.obj
                                  (label_longident :
                                    'label_longident Gram.Entry.t));
@@ -3673,6 +3710,25 @@ Very old (no more supported) syntax:\n\
                           (Gram.Action.mk
                              (fun _ (p1 : 'label_patt) (_loc : Gram.Loc.t) ->
                                 (p1 : 'label_patt_list))));
+                         ([ Gram.Snterm
+                              (Gram.Entry.obj
+                                 (label_patt : 'label_patt Gram.Entry.t));
+                            Gram.Skeyword ";"; Gram.Skeyword "_";
+                            Gram.Skeyword ";" ],
+                          (Gram.Action.mk
+                             (fun _ _ _ (p1 : 'label_patt)
+                                (_loc : Gram.Loc.t) ->
+                                (Ast.PaSem (_loc, p1, Ast.PaAny _loc) :
+                                  'label_patt_list))));
+                         ([ Gram.Snterm
+                              (Gram.Entry.obj
+                                 (label_patt : 'label_patt Gram.Entry.t));
+                            Gram.Skeyword ";"; Gram.Skeyword "_" ],
+                          (Gram.Action.mk
+                             (fun _ _ (p1 : 'label_patt) (_loc : Gram.Loc.t)
+                                ->
+                                (Ast.PaSem (_loc, p1, Ast.PaAny _loc) :
+                                  'label_patt_list))));
                          ([ Gram.Snterm
                               (Gram.Entry.obj
                                  (label_patt : 'label_patt Gram.Entry.t));
@@ -3687,6 +3743,17 @@ Very old (no more supported) syntax:\n\
                    (None,
                     [ (None, None,
                        [ ([ Gram.Snterm
+                              (Gram.Entry.obj
+                                 (label_longident :
+                                   'label_longident Gram.Entry.t)) ],
+                          (Gram.Action.mk
+                             (fun (i : 'label_longident) (_loc : Gram.Loc.t)
+                                ->
+                                (Ast.PaEq (_loc, i,
+                                   Ast.PaId (_loc,
+                                     Ast.IdLid (_loc, lid_of_ident i))) :
+                                  'label_patt))));
+                         ([ Gram.Snterm
                               (Gram.Entry.obj
                                  (label_longident :
                                    'label_longident Gram.Entry.t));
index 5088fc17273e84e260f726f2d4276e083d685ef3..3dd60b9d4f4ae8a1e2c475675a3443c3a89400cd 100644 (file)
@@ -89,7 +89,8 @@ BYTECCLINKOPTS=
 DLLCCCOMPOPTS=/Ox /MD
 
 ### Libraries needed
-EXTRALIBS=bufferoverflowu.lib
+#EXTRALIBS=bufferoverflowu.lib  # for the old PSDK compiler only
+EXTRALIBS=
 BYTECCLIBS=advapi32.lib ws2_32.lib $(EXTRALIBS)
 NATIVECCLIBS=advapi32.lib ws2_32.lib $(EXTRALIBS)
 
index 40a89e851bf6590b41e20336dfdac21458f85b23..f21bca474baa607bb58b58d44b396523b8072628 100755 (executable)
--- a/configure
+++ b/configure
@@ -576,7 +576,16 @@ if test $withsharedlibs = "yes"; then
       byteccrpath="-Wl,-rpath,"
       mksharedlibrpath="-rpath "
       shared_libraries_supported=true;;
-    i[3456]86-*-darwin[4-9]*)
+    i[3456]86-*-darwin10.*)
+      if test $arch64 == true; then
+          mksharedlib="$bytecc -bundle -flat_namespace -undefined suppress"
+          bytecccompopts="$dl_defs $bytecccompopts"
+          dl_needs_underscore=false
+          shared_libraries_supported=true
+      else
+          shared_libraries_supported=false
+      fi;;
+    i[3456]86-*-darwin*)
       mksharedlib="$bytecc -bundle -flat_namespace -undefined suppress -read_only_relocs suppress"
       bytecccompopts="$dl_defs $bytecccompopts"
       dl_needs_underscore=false
index 5fdf3da472f8f8cfd03c8af5d6e85a7c8fe265de..babb65bbe756181d300fdb9d49d4fce7911b64b1 100644 (file)
@@ -807,6 +807,22 @@ let loading_mode_variable ppf =
       find loading_modes;
       fprintf ppf "@."
 
+let follow_fork_variable =
+  (function lexbuf ->
+     let mode =
+       match identifier_eol Lexer.lexeme lexbuf with
+       | "child" -> Fork_child
+       | "parent" -> Fork_parent
+       | _ -> error "Syntax error."
+     in
+       fork_mode := mode;
+       if !loaded then update_follow_fork_mode ()),
+  function ppf ->
+    fprintf ppf "%s@."
+      (match !fork_mode with
+         Fork_child -> "child"
+       | Fork_parent -> "parent")
+
 (** Infos. **)
 
 let pr_modules ppf mods =
@@ -1106,7 +1122,14 @@ It can be either :\n\
        var_action = integer_variable false 1 "Must be at least 1"
                                      max_printer_steps;
        var_help =
-"maximal number of value nodes printed." }];
+"maximal number of value nodes printed." };
+     { var_name = "follow_fork_mode";
+       var_action = follow_fork_variable;
+       var_help =
+"process to follow after forking.\n\
+It can be either :
+  child : the newly created process.\n\
+  parent : the process that called fork.\n" }];
 
   info_list :=
     (* info name, function, help *)
index 5bfbb2bfa859412a353cdfe67c0096adca9c7e37..dfe905bac4bf7dabbcb75fd3d000e4c97f8afde6 100644 (file)
@@ -22,8 +22,25 @@ open Primitives
 
 let conn = ref Primitives.std_io
 
+(* Set which process the debugger follows on fork. *)
+
+type follow_fork_mode =
+    Fork_child
+  | Fork_parent
+
+let fork_mode = ref Fork_parent
+
+let update_follow_fork_mode () =
+  let a = match !fork_mode with Fork_child -> 0 | Fork_parent -> 1 in
+  output_char !conn.io_out 'K';
+  output_binary_int !conn.io_out a
+
+(* Set the current connection, and update the fork mode in case it has
+ * changed. *)
+
 let set_current_connection io_chan =
-  conn := io_chan
+  conn := io_chan;
+  update_follow_fork_mode ()
 
 (* Modify the program code *)
 
index 6c7a534462904f14b24fef079cdba45b29d53af8..abf4fd0b2c9fa3dc0dcfa3a325773ecc05645eb2 100644 (file)
@@ -32,6 +32,10 @@ type checkpoint_report =
     Checkpoint_done of int
   | Checkpoint_failed
 
+type follow_fork_mode =
+    Fork_child
+  | Fork_parent
+
 (* Set the current connection with the debuggee *)
 val set_current_connection : Primitives.io_channel -> unit
 
@@ -76,6 +80,10 @@ val up_frame : int -> int * int
 (* Set the trap barrier to given stack position. *)
 val set_trap_barrier : int -> unit
 
+(* Set whether the debugger follow the child or the parent process on fork *)
+val fork_mode : follow_fork_mode ref
+val update_follow_fork_mode : unit -> unit
+
 (* Handling of remote values *)
 
 exception Marshalling_error
index cae487b8d15c0b72c47fa9c7cfd0013401099b35..18480739f0e63e69f04154736aa85713ac92b272 100644 (file)
@@ -129,6 +129,7 @@ module Options = Main_args.Make_bytecomp_options (struct
   let _version = print_version_string
   let _w = (Warnings.parse_options false)
   let _warn_error = (Warnings.parse_options true)
+  let _warn_help = Warnings.help_warnings
   let _where = print_standard_library
   let _verbose = set verbose
   let _nopervasives = set nopervasives
index 8b6cedd8324d3689851b5c4a7d0b5e8d985700b2..8af91932890d6e6e5947ee2ce5b3f586c6622031 100644 (file)
@@ -258,21 +258,28 @@ let mk_vmthread f =
 
 let mk_w f =
   "-w", Arg.String f,
+  Printf.sprintf
   "<list>  Enable or disable warnings according to <list>:\n\
-  \     +<num>    enable warning <num>\n\
-  \     +<letter> enable set <letter>\n\
-  \     -<num>    disable warning <num>\n\
-  \     -<letter> disable set <letter>\n\
-  \     @<num>    enable warning <num> and treat it as an error\n\
-  \     @<letter> enable set <letter> and treat them as errors\n\
-  \     default setting is \"+a-4-6-9-27-28-29\""
+  \        +<spec>   enable warnings in <spec>\n\
+  \        -<spec>   disable warnings in <spec>\n\
+  \        @<spec>   enable warnings in <spec> and treat them as errors\n\
+  \     <spec> can be:\n\
+  \        <num>             a single warning number\n\
+  \        <num1>..<num2>    a range of consecutive warning numbers\n\
+  \        <letter>          a predefined set\n\
+  \     default setting is %S" Warnings.defaults_w
 ;;
 
 let mk_warn_error f =
   "-warn-error", Arg.String f,
+  Printf.sprintf
   "<list>  Enable or disable error status for warnings according\n\
   \     to <list>.  See option -w for the syntax of <list>.\n\
-  \     Default setting is \"-a\""
+  \     Default setting is %S" Warnings.defaults_warn_error
+;;
+
+let mk_warn_help f =
+  "-warn-help", Arg.Unit f, "  Show description of warning numbers"
 ;;
 
 let mk_where f =
@@ -401,6 +408,7 @@ module type Bytecomp_options = sig
   val _verbose : unit -> unit
   val _w : string -> unit
   val _warn_error : string -> unit
+  val _warn_help : unit -> unit
   val _where : unit -> unit
 
   val _nopervasives : unit -> unit
@@ -429,6 +437,7 @@ module type Bytetop_options = sig
   val _version : unit -> unit
   val _w : string -> unit
   val _warn_error : string -> unit
+  val _warn_help : unit -> unit
 
   val _dparsetree : unit -> unit
   val _drawlambda : unit -> unit
@@ -480,6 +489,7 @@ module type Optcomp_options = sig
   val _verbose : unit -> unit
   val _w : string -> unit
   val _warn_error : string -> unit
+  val _warn_help : unit -> unit
   val _where : unit -> unit
 
   val _nopervasives : unit -> unit
@@ -522,6 +532,7 @@ module type Opttop_options = sig
   val _version : unit -> unit
   val _w : string -> unit
   val _warn_error : string -> unit
+  val _warn_help : unit -> unit
 
   val _dparsetree : unit -> unit
   val _drawlambda : unit -> unit
@@ -596,6 +607,7 @@ struct
     mk_vmthread F._vmthread;
     mk_w F._w;
     mk_warn_error F._warn_error;
+    mk_warn_help F._warn_help;
     mk_where F._where;
 
     mk_nopervasives F._nopervasives;
@@ -627,6 +639,7 @@ struct
     mk_version F._version;
     mk_w F._w;
     mk_warn_error F._warn_error;
+    mk_warn_help F._warn_help;
 
     mk_dparsetree F._dparsetree;
     mk_drawlambda F._drawlambda;
@@ -682,6 +695,7 @@ struct
     mk_verbose F._verbose;
     mk_w F._w;
     mk_warn_error F._warn_error;
+    mk_warn_help F._warn_help;
     mk_where F._where;
 
     mk_nopervasives F._nopervasives;
@@ -724,6 +738,7 @@ module Make_opttop_options (F : Opttop_options) = struct
     mk_version F._version;
     mk_w F._w;
     mk_warn_error F._warn_error;
+    mk_warn_help F._warn_help;
 
     mk_dparsetree F._dparsetree;
     mk_drawlambda F._drawlambda;
index 874410f98a6861e447b249c6b233f23e52f90f81..e0a7e2fa969a2aae95a3f88d3350216164abe3ee 100644 (file)
@@ -54,6 +54,7 @@ module type Bytecomp_options =
     val _verbose : unit -> unit
     val _w : string -> unit
     val _warn_error : string -> unit
+    val _warn_help : unit -> unit
     val _where : unit -> unit
 
     val _nopervasives : unit -> unit
@@ -83,6 +84,7 @@ module type Bytetop_options = sig
   val _version : unit -> unit
   val _w : string -> unit
   val _warn_error : string -> unit
+  val _warn_help : unit -> unit
 
   val _dparsetree : unit -> unit
   val _drawlambda : unit -> unit
@@ -134,6 +136,7 @@ module type Optcomp_options = sig
   val _verbose : unit -> unit
   val _w : string -> unit
   val _warn_error : string -> unit
+  val _warn_help : unit -> unit
   val _where : unit -> unit
 
   val _nopervasives : unit -> unit
@@ -176,6 +179,7 @@ module type Opttop_options = sig
   val _version : unit -> unit
   val _w : string -> unit
   val _warn_error : string -> unit
+  val _warn_help : unit -> unit
 
   val _dparsetree : unit -> unit
   val _drawlambda : unit -> unit
index 53b19a75e5fc4f10a421c7e0a98e5ace8a32e414..51a9162d635ddcbce128fb792fe48f1575076e7c 100644 (file)
@@ -138,6 +138,7 @@ module Options = Main_args.Make_optcomp_options (struct
   let _verbose = set verbose
   let _w s = Warnings.parse_options false s
   let _warn_error s = Warnings.parse_options true s
+  let _warn_help = Warnings.help_warnings
   let _where () = print_standard_library ()
 
   let _nopervasives = set nopervasives
index e6517185a9ca08221c1b5d315e51ed6155983cdb..2adba6752f2dd7db60a911d274afbe9e6d1feb0c 100644 (file)
@@ -497,7 +497,8 @@ This uses info files produced by HeVeA.
     (message "Scanning info files in %s" dir)
     (save-window-excursion
       (set-buffer (get-buffer-create "*caml-help*"))
-      (or (shell-command command (current-buffer)) (error "HERE"))
+      (or (shell-command command (current-buffer))
+          (error "Could not run:%s" command))
       (goto-char (point-min))
       (while (re-search-forward module-regexp (point-max) t)
         (if (equal (char-after (match-end 1)) 127)
@@ -624,7 +625,8 @@ current buffer using \\[ocaml-qualified-identifier]."
             (progn
               (message "Help for entry %s not found in module %s"
                        entry module)
-              (goto-char here)))))
+              (goto-char here)))
+          ))
     (ocaml-link-activate (cdr info-section))
     (if (window-live-p window) (select-window window))
     ))
@@ -778,26 +780,27 @@ buffer positions."
                               (mapconcat 'car links "\\|")
                               "\\)[^A-Za-z0-9'_]"))
               (case-fold-search nil))
-          (goto-char (point-min))
-          (let ((buffer-read-only nil)
-                ;; use of dynamic scoping, need not be restored!
-                (modified-p (buffer-modified-p)))
-            (unwind-protect
-                (save-excursion
-                  (goto-char (point-min))
-                  (while (re-search-forward regexp (point-max) t)
-                    (put-text-property (match-beginning 1) (match-end 1)
-                                       'mouse-face 'highlight)
-                    (put-text-property (match-beginning 1) (match-end 1)
-                                       'local-map ocaml-link-map)
-                    (if (x-display-color-p)
-                        (put-text-property (match-beginning 1) (match-end 1)
-                                           'face 'ocaml-link-face)))
-                  )
-              ;; need to restore flag if buffer was unmodified.
-              (unless modified-p (set-buffer-modified-p nil))
-              ))
-          ))))
+          (save-excursion
+            (goto-char (point-min))
+            (let ((buffer-read-only nil)
+                  ;; use of dynamic scoping, need not be restored!
+                  (modified-p (buffer-modified-p)))
+              (unwind-protect
+                  (save-excursion
+                    (goto-char (point-min))
+                    (while (re-search-forward regexp (point-max) t)
+                      (put-text-property (match-beginning 1) (match-end 1)
+                                         'mouse-face 'highlight)
+                      (put-text-property (match-beginning 1) (match-end 1)
+                                         'local-map ocaml-link-map)
+                      (if (x-display-color-p)
+                          (put-text-property (match-beginning 1) (match-end 1)
+                                             'face 'ocaml-link-face)))
+                    )
+                ;; need to restore flag if buffer was unmodified.
+                (unless modified-p (set-buffer-modified-p nil))
+                ))
+            )))))
 
 
 
index cc51c8265c56efbfaa6b5aee3e57c1bf532b31e7..d5ba599cc78c81b4e0467cb00b2dd4012ec7149b 100644 (file)
@@ -573,7 +573,11 @@ the camldebug commands `cd DIR' and `directory'."
   (let ((output))
     (if (buffer-name (process-buffer proc))
         (let ((process-window))
-          (save-excursion
+          ;; it does not seem necessary to save excursion here,
+          ;; since set-buffer as a temporary effect.
+          ;; comint-output-filter explicitly avoids it. 
+          ;; in version 23, it prevents the marker to stay at end of buffer
+          ;; (save-excursion
             (set-buffer (process-buffer proc))
             ;; If we have been so requested, delete the debugger prompt.
             (if (marker-buffer camldebug-delete-prompt-marker)
@@ -590,7 +594,12 @@ the camldebug commands `cd DIR' and `directory'."
                                       (>= (point) (process-mark proc))
                                       (get-buffer-window (current-buffer))))
             ;; Insert the text, moving the process-marker.
-            (comint-output-filter proc output))
+            (comint-output-filter proc output)
+          ;; ) 
+          ;; this was the end of save-excursion. 
+          ;; if save-excursion is used (comint-next-prompt 1) would be needed
+          ;; to move the mark past then next prompt, but this is not as good
+          ;; as solution.
           (if process-window
               (save-selected-window
                 (select-window process-window)
index f2291f90fd0cf4e237d5df10472fd3adfc1cbea7..ba2eb0390b7b369b37c0a7333983c0bca337a68c 100644 (file)
@@ -94,8 +94,9 @@ be sent from another buffer in Caml mode.
   (if (string-match "[^ ]" s) (setq inferior-caml-output t)))
 
 (defun inferior-caml-mode-output-hook ()
-  (setq comint-output-filter-functions
-        (list (function inferior-caml-signal-output))))
+  (set-variable 'comint-output-filter-functions
+        (list (function inferior-caml-signal-output)) 
+        t))
 (add-hook 'inferior-caml-mode-hooks 'inferior-caml-mode-output-hook)
 
 ;; To launch ocaml whenever needed
index dd818e78450d8c24b08b30d34a8dc6acd8a1afbb..9bc0906afd8083dc06d8ff1b05cfa46f9137b7ba 100644 (file)
@@ -54,11 +54,11 @@ let as_cset = function
 %token Tstar Tmaybe Tplus Tlparen Trparen Tcaret Tdash Tlet Tas Tsharp
 
 %right Tas
-%left Tsharp
 %left Tor
 %nonassoc CONCAT
 %nonassoc Tmaybe Tstar Tplus
-          Tident Tchar Tstring Tunderscore Teof Tlbracket Tlparen
+%left Tsharp
+%nonassoc Tident Tchar Tstring Tunderscore Teof Tlbracket Tlparen
 
 %start lexer_definition
 %type <Syntax.lexer_definition> lexer_definition
index 92067c4d636b66d0ebbfb4584b2908a96b1a8ad6..2ee15ff942379238e48cfce2309b3f4ee1b41444 100644 (file)
@@ -45,30 +45,21 @@ let syscamllib x =
   if ccomptype = "msvc" then A(Printf.sprintf "lib%s.lib" x)
   else A("-l"^x)
 
-let mkobj obj file opts =
-  let obj = obj-.-C.o in
+let ccoutput cc obj file =
   if ccomptype = "msvc" then
-    Seq[Cmd(S[Sh C.bytecc; Sh C.bytecccompopts; opts; A"-c"; Px file]);
+    Seq[Cmd(S[cc; A"-c"; Px file]);
         mv (Pathname.basename (Pathname.update_extension C.o file)) obj]
   else
-    Cmd(S[Sh C.bytecc; Sh C.bytecccompopts; opts; A"-c"; P file; A"-o"; Px obj])
+    Cmd(S[cc; A"-c"; P file; A"-o"; Px obj])
 
-let mkdynobj obj file opts =
-  let d_obj = obj-.-"d"-.-C.o in
-  if ccomptype = "msvc" then
-    Seq[Cmd(S[Sh C.bytecc; opts; Sh C.dllcccompopts; A"-c"; Px file]);
-        mv (Pathname.basename (Pathname.update_extension C.o file)) d_obj]
-  else
-    Cmd(S[Sh C.bytecc; opts; Sh C.dllcccompopts; A"-c"; P file; A"-o"; Px d_obj])
+let mkobj obj file opts =
+  let tags = tags_of_pathname file++"c"++"compile"++ccomptype in
+  let bytecc_with_opts = S[Sh C.bytecc; Sh C.bytecccompopts; opts; T tags] in
+  ccoutput bytecc_with_opts obj file
 
 let mknatobj obj file opts =
-  let obj = obj-.-C.o in
-  if ccomptype = "msvc" then
-    Seq[Cmd(S[Sh C.nativecc; opts; A"-c"; Px file]);
-        mv (Pathname.basename (Pathname.update_extension C.o file)) obj]
-  else
-    Cmd(S[Sh C.nativecc; A"-O"; opts;
-          Sh C.nativecccompopts; A"-c"; P file; A"-o"; Px obj])
+  let nativecc_with_opts = S[Sh C.nativecc; opts; Sh C.nativecccompopts] in
+  ccoutput nativecc_with_opts obj file
 
 let add_exe a =
   if not windows || Pathname.check_extension a "exe" then a
@@ -126,6 +117,11 @@ let dynlink_dir    = if_mixed_dir "otherlibs/dynlink";;
 let str_dir        = if_mixed_dir "otherlibs/str";;
 let toplevel_dir   = if_mixed_dir "toplevel";;
 
+let systhreads_file f = "otherlibs/systhreads"/f
+let systhreads_obj f = "otherlibs/systhreads"/f-.-C.o
+let systhreads_lib f = "otherlibs/systhreads"/f-.-C.a
+let systhreads_dll f = "otherlibs/systhreads"/f-.-C.so
+
 let ocamlc_solver =
   let native_deps = ["ocamlc.opt"; "stdlib/stdlib.cmxa";
                     "stdlib/std_exit.cmx"; "stdlib/std_exit"-.-C.o] in
@@ -196,12 +192,10 @@ dispatch begin function
 
 let hot_camlp4boot = "camlp4"/"boot"/"camlp4boot.byte";;
 let cold_camlp4boot = "camlp4boot" (* The installed version *);;
+let cold_camlp4o = "camlp4o" (* The installed version *);;
 
 flag ["ocaml"; "ocamlyacc"] (A"-v");;
 
-flag ["ocaml"; "compile"; "warn_Aler"] (S[A"-w";A"Aler"; A"-warn-error";A"Almer"]);;
-flag ["ocaml"; "compile"; "warn_Alerzv"] (S[A"-w";A"Alerzv"; A"-warn-error";A"Almerzv"]);;
-
 non_dependency "otherlibs/threads/pervasives.ml" "Unix";;
 non_dependency "otherlibs/threads/pervasives.ml" "String";;
 
@@ -314,13 +308,6 @@ copy_rule "The thread specific unix library (mllib)"     ~insert:`bottom "otherl
 (* Temporary rule, waiting for a full usage of ocamlbuild *)
 copy_rule "Temporary rule, waiting for a full usage of ocamlbuild" "%.mlbuild" "%.ml";;
 
-if windows then
-  copy_rule "thread_win32.ml -> thread.ml"
-    "otherlibs/systhreads/thread_win32.ml" "otherlibs/systhreads/thread.ml"
-else
-  copy_rule "thread_posix.ml -> thread.ml"
-    "otherlibs/systhreads/thread_posix.ml" "otherlibs/systhreads/thread.ml";;
-
 copy_rule "graph/graphics.ml -> win32graph/graphics.ml" "otherlibs/graph/graphics.ml" "otherlibs/win32graph/graphics.ml";;
 copy_rule "graph/graphics.mli -> win32graph/graphics.mli" "otherlibs/graph/graphics.mli" "otherlibs/win32graph/graphics.mli";;
 
@@ -410,17 +397,7 @@ rule "C files"
   ~dep:"%.c"
   ~insert:(`before "ocaml C stubs: c -> o")
   begin fun env _ ->
-    let c = env "%.c" in
-    mkobj (env "%") c (T(tags_of_pathname c++"c"++"compile"++ccomptype))
-  end;;
-
-rule "C files for windows dynamic libraries"
-  ~prod:("%.d"-.-C.o)
-  ~dep:"%.c"
-  ~insert:(`before "C files")
-  begin fun env _ ->
-    let c = env "%.c" in
-    mkdynobj (env "%") c (T(tags_of_pathname c++"c"++"compile"++"dll"++ccomptype))
+    mkobj (env ("%"-.-C.o)) (env "%.c") N
   end;;
 
 (* ../ is because .h files are not dependencies so they are not imported in build dir *)
@@ -484,89 +461,54 @@ flag ["c"; "compile"; "otherlibs_labltk"] (S[A"-Ibyterun"; Sh C.tk_defs; Sh C.sh
 
 (* Sys threads *)
 
-rule "posix native systhreads"
-  ~prod:"otherlibs/systhreads/posix_n.o"
-  ~dep:"otherlibs/systhreads/posix.c"
-  ~insert:`top
-  begin fun _ _ ->
-    Cmd(S[Sh C.nativecc; A"-O"; A"-I../asmrun"; A"-I../byterun";
-          Sh C.nativecccompopts; Sh C.sharedcccompopts;
-          A"-DNATIVE_CODE"; A("-DTARGET_"^C.arch); A("-DSYS_"^C.system); A"-c";
-          A"otherlibs/systhreads/posix.c"; A"-o"; Px"otherlibs/systhreads/posix_n.o"])
-  end;;
-
-rule "posix bytecode systhreads"
-  ~prod:"otherlibs/systhreads/posix_b.o"
-  ~dep:"otherlibs/systhreads/posix.c"
-  ~insert:`top
-  begin fun _ _ ->
-    Cmd(S[Sh C.bytecc; A"-O"; A"-I../byterun";
-          Sh C.bytecccompopts; Sh C.sharedcccompopts;
-          A"-c"; A"otherlibs/systhreads/posix.c"; A"-o"; Px"otherlibs/systhreads/posix_b.o"])
-  end;;
-
-rule "windows native systhreads"
-  ~prod:("otherlibs/systhreads/win32_n"-.-C.o)
-  ~dep:"otherlibs/systhreads/win32.c"
-  ~insert:`top
-  begin fun _ _ ->
-    mknatobj "otherlibs/systhreads/win32_n"
-             "otherlibs/systhreads/win32.c"
-             (S[A"-I../asmrun"; A"-I../byterun"; A"-DNATIVE_CODE"])
-  end;;
+let systhreads_stubs_headers =
+  List.map systhreads_file
+    [if windows then "st_win32.h" else "st_posix.h"; "threads.h"]
+;;
 
-rule "windows bytecode static systhreads"
-  ~prod:("otherlibs/systhreads/win32_b"-.-C.o)
-  ~dep:"otherlibs/systhreads/win32.c"
+rule "native systhreads"
+  ~prod:(systhreads_obj "st_stubs_n")
+  ~deps:(systhreads_file "st_stubs.c" :: systhreads_stubs_headers)
   ~insert:`top
   begin fun _ _ ->
-    mkobj "otherlibs/systhreads/win32_b" "otherlibs/systhreads/win32.c"
-          ((*A"-O"; why ? *) A"-I../byterun")
+    mknatobj (systhreads_obj "st_stubs_n")
+             (systhreads_file "st_stubs.c")
+             (S[A"-I../asmrun"; A"-I../byterun"; A"-Iotherlibs/systhreads";
+                if windows then N else Sh C.sharedcccompopts;
+                A"-DNATIVE_CODE"; A("-DTARGET_"^C.arch); A("-DSYS_"^C.system)])
   end;;
 
-rule "windows bytecode dynamic systhreads"
-  ~prod:("otherlibs/systhreads/win32_b.d"-.-C.o)
-  ~dep:"otherlibs/systhreads/win32.c"
+rule "bytecode systhreads"
+  ~prod:(systhreads_obj "st_stubs_b")
+  ~deps:(systhreads_file "st_stubs.c" :: systhreads_stubs_headers)
   ~insert:`top
   begin fun _ _ ->
-    mkdynobj "otherlibs/systhreads/win32_b" "otherlibs/systhreads/win32.c"
-             ((*A"-O"; why ? *) A"-I../byterun")
+    mkobj (systhreads_obj "st_stubs_b") (systhreads_file "st_stubs.c")
+          (S[A"-I../byterun"; A"-Iotherlibs/systhreads"; Sh C.sharedcccompopts])
   end;;
 
-if windows then begin
-  rule "windows libthreadsnat.a"
-    ~prod:("otherlibs/systhreads/libthreadsnat"-.-C.a)
-    ~dep:("otherlibs/systhreads/win32_n"-.-C.o)
-    ~insert:`top
-    begin fun _ _ ->
-      mklib ("otherlibs/systhreads/libthreadsnat"-.-C.a) (P("otherlibs/systhreads/win32_n"-.-C.o)) N
-    end
-end else begin
-(* Dynamic linking with -lpthread is risky on many platforms, so
-   do not create a shared object for libthreadsnat. *)
 rule "libthreadsnat.a"
-  ~prod:"otherlibs/systhreads/libthreadsnat.a"
-  ~dep:"otherlibs/systhreads/posix_n.o"
+  ~prod:(systhreads_lib "libthreadsnat")
+  ~dep:(systhreads_obj "st_stubs_n")
   ~insert:`top
   begin fun _ _ ->
-    mklib "otherlibs/systhreads/libthreadsnat.a" (A"otherlibs/systhreads/posix_n.o") N
+    if windows then
+      mklib (systhreads_lib "libthreadsnat") (P(systhreads_obj "st_stubs_n")) N
+    else
+      (* Dynamic linking with -lpthread is risky on many platforms, so
+        do not create a shared object for libthreadsnat. *)
+      Cmd(S[ar; A"rc"; Px(systhreads_lib "libthreadsnat");
+            P(systhreads_obj "st_stubs_n")])
   end;
 
 (* See remark above: force static linking of libthreadsnat.a *)
-flag ["ocaml"; "link"; "library"; "otherlibs_systhreads"; "native"] begin
-  S[A"-cclib"; syscamllib "threadsnat"; (* A"-cclib"; syscamllib "unix"; seems to be useless and can be dangerous during bootstrap *) Sh C.pthread_link]
-end;
-end;;
-
 if windows then
-copy_rule "systhreads/libthreads.clib is diffrent on windows"
-  ~insert:`top
-  ("otherlibs/systhreads/libthreadswin32"-.-C.a)
-  ("otherlibs/systhreads/libthreads"-.-C.a);;
+  flag ["ocaml"; "link"; "library"; "otherlibs_systhreads"; "native"] begin
+    S[A"-cclib"; syscamllib "threadsnat"; (* A"-cclib"; syscamllib "unix"; seems to be useless and can be dangerous during bootstrap *) Sh C.pthread_link]
+  end;;
 
 flag ["ocaml"; "ocamlmklib"; "otherlibs_systhreads"] (S[(* A"-cclib"; syscamllib "unix";; seems to be useless and can be dangerous during bootstrap *) Sh C.pthread_link]);;
 
-
 flag ["c"; "compile"; "otherlibs"] begin
   S[A"-I"; P"../byterun";
     A"-I"; P(".."/unix_dir);
@@ -641,28 +583,6 @@ rule "camlheader"
             A"cp"; A"stdlib/camlheader"; A"stdlib/camlheader_ur"])
   end;;
 
-rule "ocaml C stubs on windows: dlib & d.o* -> dll"
-  ~prod:"%.dll"
-  ~deps:["%.dlib"(*; "byterun/libcamlrun"-.-C.a*)]
-  ~insert:`top
-  begin fun env build ->
-    let dlib = env "%.dlib" in
-    let dll = env "%.dll" in
-    let objs = string_list_of_file dlib in
-    let include_dirs = Pathname.include_dirs_of (Pathname.dirname dll) in
-    let resluts = build begin
-      List.map begin fun d_o ->
-        List.map (fun dir -> dir / (Pathname.update_extension C.o d_o)) include_dirs
-      end objs
-    end in
-    let objs = List.map begin function
-      | Outcome.Good d_o -> d_o
-      | Outcome.Bad exn -> raise exn
-    end resluts in
-    mkdll dll (S[atomize objs; P("byterun/libcamlrun"-.-C.a)])
-          (T(tags_of_pathname dll++"dll"++"link"++"c"))
-  end;;
-
 copy_rule "win32unix use some unix files" "otherlibs/unix/%" "otherlibs/win32unix/%";;
 
 (* Temporary rule *)
@@ -834,7 +754,7 @@ rule "camlp4: Camlp4/Struct/Lexer.ml -> boot/Lexer.ml"
   ~prod:"camlp4/boot/Lexer.ml"
   ~dep:"camlp4/Camlp4/Struct/Lexer.ml"
   begin fun _ _ ->
-    Cmd(S[P"camlp4o"; P"camlp4/Camlp4/Struct/Lexer.ml";
+    Cmd(S[P cold_camlp4o; P"camlp4/Camlp4/Struct/Lexer.ml";
           A"-printer"; A"r"; A"-o"; Px"camlp4/boot/Lexer.ml"])
   end;;
 
@@ -928,8 +848,6 @@ Pathname.define_context "otherlibs/labltk/jpf"
   ["otherlibs/labltk/jpf"; "otherlibs/labltk/labltk"; "otherlibs/labltk/support"; "stdlib"];;
 Pathname.define_context "otherlibs/labltk/frx"
   ["otherlibs/labltk/frx"; "otherlibs/labltk/camltk"; "otherlibs/labltk/support"; "stdlib"];;
-Pathname.define_context "otherlibs/labltk/tkanim"
-  ["otherlibs/labltk/tkanim"; "otherlibs/labltk/camltk"; "otherlibs/labltk/support"; "stdlib"];;
 Pathname.define_context "otherlibs/labltk/browser"
   ["otherlibs/labltk/browser"; "otherlibs/labltk/labltk"; "otherlibs/labltk/support"; "parsing"; "utils"; "typing"; "stdlib"];;
 
index 36bf9ee9f1098a7539a716c13c17b58ea1f94cc2..0f1903369773f49e631408a415d1391bae3bfe17 100644 (file)
@@ -1,3 +1,17 @@
+#########################################################################
+#                                                                       #
+#                            Objective Caml                             #
+#                                                                       #
+#   Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt  #
+#                                                                       #
+#   Copyright 2007 Institut National de Recherche en Informatique et    #
+#   en Automatique.  All rights reserved.  This file is distributed     #
+#   under the terms of the Q Public License version 1.0.                #
+#                                                                       #
+#########################################################################
+
+# $Id$
+
 .PHONY: all byte native profile debug ppcache doc
 
 ifndef INSTALL_PREFIX
index 48081d073459e4d80b47fa7b09d5b6686f4d0dc9..617d6a72f385e5b09678ace29e2255e32a83c6b0 100644 (file)
@@ -1,6 +1,6 @@
 # OCamlbuild tags file
 true: debug
-<*.ml> or <*.mli>: warn_A, warn_error_A, warn_e, annot
+<*.ml> or <*.mli>: warn_L, warn_R, warn_Z, annot
 "discard_printf.ml": rectypes
 "ocamlbuildlib.cma" or "ocamlbuildlightlib.cma": linkall
 <*.byte> or <*.native> or <*.top>: use_unix
index b0aba86c7f721f9cf37d0e10f94d03159ec2b0f2..851a3be007ddea7b4c60fa3303feb891eacb106d 100644 (file)
@@ -200,8 +200,8 @@ odoc_text_lexer.cmo: odoc_text_parser.cmi odoc_misc.cmi
 odoc_text_lexer.cmx: odoc_text_parser.cmx odoc_misc.cmx
 odoc_text_parser.cmo: odoc_types.cmi odoc_misc.cmi odoc_text_parser.cmi
 odoc_text_parser.cmx: odoc_types.cmx odoc_misc.cmx odoc_text_parser.cmi
-odoc_to_text.cmo: odoc_messages.cmo odoc_info.cmi
-odoc_to_text.cmx: odoc_messages.cmx odoc_info.cmx
+odoc_to_text.cmo: odoc_module.cmo odoc_messages.cmo odoc_info.cmi
+odoc_to_text.cmx: odoc_module.cmx odoc_messages.cmx odoc_info.cmx
 odoc_type.cmo: ../typing/types.cmi odoc_types.cmi odoc_name.cmi \
     ../parsing/asttypes.cmi
 odoc_type.cmx: ../typing/types.cmx odoc_types.cmx odoc_name.cmx \
index 83ba02b06638e34248ab5ca9386586f3ac60beaa..143da019d34fa55f0b0d7bd287cd1b4c20eac729 100644 (file)
@@ -427,6 +427,8 @@ and remove_module_elements_between_stop_in_module_kind k =
   | Odoc_module.Module_constraint (k2, mtkind) ->
       Odoc_module.Module_constraint (remove_module_elements_between_stop_in_module_kind k2,
                          remove_module_elements_between_stop_in_module_type_kind mtkind)
+  | Odoc_module.Module_typeof _ -> k
+  | Odoc_module.Module_unpack _ -> k
 
 (** Remove the module elements between the stop special comment, in the given module type kind. *)
 and remove_module_elements_between_stop_in_module_type_kind tk =
@@ -437,7 +439,7 @@ and remove_module_elements_between_stop_in_module_type_kind tk =
   | Odoc_module.Module_type_alias _ -> tk
   | Odoc_module.Module_type_with (tk2, s) ->
       Odoc_module.Module_type_with (remove_module_elements_between_stop_in_module_type_kind tk2, s)
-
+  | Odoc_module.Module_type_typeof _ -> tk
 
 (** Remove elements between the stop special comment. *)
 let remove_elements_between_stop module_list =
index 4922d059a4704a84726d63018dba3b50ebe0cc48..3456e14dea970b32c9c5064111785119cac37286 100644 (file)
@@ -1647,6 +1647,24 @@ module Analyser =
             m_kind = Module_struct elements2 ;
           }
 
+      | (Parsetree.Pmod_unpack (p_exp, pkg_type),
+         Typedtree.Tmod_unpack (t_exp, tt_modtype)) ->
+          print_DEBUG ("Odoc_ast: case Parsetree.Pmod_unpack + Typedtree.Tmod_unpack "^module_name);
+          let code =
+            let loc = p_module_expr.Parsetree.pmod_loc in
+            let loc_end = loc.Location.loc_end.Lexing.pos_cnum in
+            let exp_loc = p_exp.Parsetree.pexp_loc in
+            let exp_loc_end = exp_loc.Location.loc_end.Lexing.pos_cnum in
+            let s = get_string_of_file exp_loc_end loc_end in
+            Printf.sprintf "(val ...%s" s
+          in
+          let name = Odoc_env.full_module_type_name env (Name.from_longident (fst pkg_type)) in
+          let alias = { mta_name = name ; mta_module = None } in
+          { m_base with
+            m_type = Odoc_env.subst_module_type env tt_modtype ;
+            m_kind = Module_unpack (code, alias) ;
+          }
+
       | (parsetree, typedtree) ->
           (*DEBUG*)let s_parse =
           (*DEBUG*)  match parsetree with
@@ -1655,6 +1673,7 @@ module Analyser =
           (*DEBUG*)  | Parsetree.Pmod_functor _ -> "Pmod_functor"
           (*DEBUG*)  | Parsetree.Pmod_apply _ -> "Pmod_apply"
           (*DEBUG*)  | Parsetree.Pmod_constraint _ -> "Pmod_constraint"
+          (*DEBUG*)  | Parsetree.Pmod_unpack _ -> "Pmod_unpack"
           (*DEBUG*)in
           (*DEBUG*)let s_typed =
           (*DEBUG*)  match typedtree with
@@ -1663,6 +1682,7 @@ module Analyser =
           (*DEBUG*)  | Typedtree.Tmod_functor _ -> "Tmod_functor"
           (*DEBUG*)  | Typedtree.Tmod_apply _ -> "Tmod_apply"
           (*DEBUG*)  | Typedtree.Tmod_constraint _ -> "Tmod_constraint"
+          (*DEBUG*)  | Typedtree.Tmod_unpack _ -> "Tmod_unpack"
           (*DEBUG*)in
           (*DEBUG*)let code = get_string_of_file pos_start pos_end in
           print_DEBUG (Printf.sprintf "code=%s\ns_parse=%s\ns_typed=%s\n" code s_parse s_typed);
index 2f81e5dbb54a128b419a4c1627cc3692b66e4e72..4d9f3ca29142b2ae157ad8451716a009f1db68e4 100644 (file)
@@ -343,6 +343,34 @@ let rec associate_in_module module_list (acc_b_modif, acc_incomplete_top_module_
           { mt_name = "" ; mt_info = None ; mt_type = None ;
             mt_is_interface = false ; mt_file = "" ; mt_kind = Some tk ;
             mt_loc = Odoc_types.dummy_loc }
+
+     | Module_typeof _ ->
+        (acc_b, acc_inc, acc_names)
+
+     | Module_unpack (code, mta) ->
+        begin
+          match mta.mta_module with
+            Some _ ->
+              (acc_b, acc_inc, acc_names)
+          | None ->
+              let mt_opt =
+                try Some (lookup_module_type mta.mta_name)
+                with Not_found -> None
+              in
+              match mt_opt with
+                None -> (acc_b, (Name.head m.m_name) :: acc_inc,
+                   (* we don't want to output warning messages for
+                      "sig ... end" or "struct ... end" modules not found *)
+                   (if mta.mta_name = Odoc_messages.struct_end or
+                      mta.mta_name = Odoc_messages.sig_end then
+                      acc_names
+                    else
+                      (NF_mt mta.mta_name) :: acc_names)
+                  )
+              | Some mt ->
+                  mta.mta_module <- Some mt ;
+                  (true, acc_inc, acc_names)
+        end
   in
   iter_kind (acc_b_modif, acc_incomplete_top_module_names, acc_names_not_found) m.m_kind
 
@@ -362,27 +390,31 @@ and associate_in_module_type module_list (acc_b_modif, acc_incomplete_top_module
         iter_kind (acc_b, acc_inc, acc_names) k
 
     | Module_type_alias mta ->
-        match mta.mta_module with
-           Some _ ->
-             (acc_b, acc_inc, acc_names)
-         | None ->
-             let mt_opt =
-               try Some (lookup_module_type mta.mta_name)
-               with Not_found -> None
-             in
-             match mt_opt with
-               None -> (acc_b, (Name.head mt.mt_name) :: acc_inc,
-                        (* we don't want to output warning messages for
-                           "sig ... end" or "struct ... end" modules not found *)
-                        (if mta.mta_name = Odoc_messages.struct_end or
-                          mta.mta_name = Odoc_messages.sig_end then
-                          acc_names
-                        else
-                          (NF_mt mta.mta_name) :: acc_names)
-                       )
-             | Some mt ->
-                 mta.mta_module <- Some mt ;
-                 (true, acc_inc, acc_names)
+        begin
+          match mta.mta_module with
+            Some _ ->
+              (acc_b, acc_inc, acc_names)
+          | None ->
+              let mt_opt =
+                try Some (lookup_module_type mta.mta_name)
+                with Not_found -> None
+              in
+              match mt_opt with
+                None -> (acc_b, (Name.head mt.mt_name) :: acc_inc,
+                   (* we don't want to output warning messages for
+                      "sig ... end" or "struct ... end" modules not found *)
+                   (if mta.mta_name = Odoc_messages.struct_end or
+                      mta.mta_name = Odoc_messages.sig_end then
+                      acc_names
+                    else
+                      (NF_mt mta.mta_name) :: acc_names)
+                  )
+              | Some mt ->
+                  mta.mta_module <- Some mt ;
+                  (true, acc_inc, acc_names)
+        end
+    | Module_type_typeof _ ->
+        (acc_b, acc_inc, acc_names)
   in
   match mt.mt_kind with
     None -> (acc_b_modif, acc_incomplete_top_module_names, acc_names_not_found)
@@ -795,6 +827,8 @@ and assoc_comments_module_kind parent_name module_list mk =
       Module_constraint
         (assoc_comments_module_kind parent_name module_list mk1,
          assoc_comments_module_type_kind parent_name module_list mtk)
+  | Module_typeof _ -> mk
+  | Module_unpack _ -> mk
 
 and assoc_comments_module_type_kind parent_name module_list mtk =
   match mtk with
@@ -809,6 +843,7 @@ and assoc_comments_module_type_kind parent_name module_list mtk =
   | Module_type_with (mtk1, s) ->
       Module_type_with
         (assoc_comments_module_type_kind parent_name module_list mtk1, s)
+  | Module_type_typeof _ -> mtk
 
 and assoc_comments_class_kind parent_name module_list ck =
   match ck with
index cf86d1b333b88ae3d9c064e47f35d84a7a918620..7cfb9890c92c986b561d0d2debbfab625021efcb 100644 (file)
@@ -1225,6 +1225,22 @@ class html =
       | Module_constraint (k, tk) ->
           (* TODO: on affiche quoi ? *)
           self#html_of_module_kind b father ?modu k
+      | Module_typeof s ->
+          bs b "<code class=\"type\">module type of ";
+          bs b (self#create_fully_qualified_module_idents_links father s);
+          bs b "</code>"
+      | Module_unpack (code, mta) ->
+          bs b "<code class=\"type\">";
+          begin
+            match mta.mta_module with
+              None ->
+                bs b (self#create_fully_qualified_module_idents_links father (self#escape code))
+            | Some mt ->
+                let (html_file, _) = Naming.html_files mt.mt_name in
+                bp b " <a href=\"%s\">%s</a> " html_file (self#escape code)
+          end;
+          bs b "</code>"
+
 
     method html_of_module_parameter b father p =
       let (s_functor,s_arrow) =
@@ -1298,6 +1314,10 @@ class html =
           bs b "<code class=\"type\"> ";
           bs b (self#create_fully_qualified_module_idents_links father s);
           bs b "</code>"
+      | Module_type_typeof s ->
+          bs b "<code class=\"type\">module type of ";
+          bs b (self#create_fully_qualified_module_idents_links father s);
+          bs b "</code>"
 
     (** Print html code to display the type of a module parameter.. *)
     method html_of_module_parameter_type b m_name p =
index d9c0cfeb425675118f2081977be8d2abae1bd14e..4dc569547f4fe8eca363a503db14b657e97a758d 100644 (file)
@@ -447,6 +447,8 @@ module Module :
                         Should appear in interface files only. *)
       | Module_constraint of module_kind * module_type_kind
                      (** A module constraint by a module type. *)
+      | Module_typeof of string (** by now only the code of the module expression *)
+      | Module_unpack of string * module_type_alias (** code of the expression and module type alias *)
 
     (** Representation of a module. *)
     and t_module = Odoc_module.t_module =
@@ -479,6 +481,8 @@ module Module :
             (** Complete alias name and corresponding module type if we found it. *)
       | Module_type_with of module_type_kind * string
             (** The module type kind and the code of the with constraint. *)
+      | Module_type_typeof of string
+            (** by now only the code of the module expression *)
 
     (** Representation of a module type. *)
     and t_module_type = Odoc_module.t_module_type =
index d35b2f31062d42ea9c479a8c65ee82edc84272bc..3750996a452086de1adbdee5075ad21ea983ab9a 100644 (file)
@@ -102,8 +102,8 @@ class text =
       ("\\.\\.\\.", "$\\ldots$");
       ("\\\\", "MAXENCE"^"XXX") ;
       ("&", "MAXENCE"^"YYY") ;
-      ("\\$", "MAXENCE"^"ZZZ")
-     ]
+      ("\\$", "MAXENCE"^"ZZZ");
+    ]
 
     val mutable subst_strings_simple =
       [
@@ -624,6 +624,11 @@ class latex =
             [ Code " ";
               Code (self#relative_idents father s);
             ]
+      | Module_type_typeof s ->
+          self#latex_of_text fmt
+            [ Code "module type of ";
+              Code (self#relative_idents father s);
+            ]
 
     method latex_of_module_kind fmt father kind =
       match kind with
@@ -654,6 +659,16 @@ class latex =
       | Module_constraint (k, tk) ->
           (* TODO: on affiche quoi ? *)
           self#latex_of_module_kind fmt father k
+      | Module_typeof s ->
+          self#latex_of_text fmt
+            [ Code "module type of ";
+              Code (self#relative_idents father s);
+            ]
+      | Module_unpack (s, _) ->
+          self#latex_of_text fmt
+            [
+              Code (self#relative_idents father s);
+            ]
 
     method latex_of_class_kind fmt father kind =
       match kind with
index 3352bd8df1c86f517f3d3fee0138a4475df900c3..cc1fe02ca8083ed739df19c0728ba3e2f4411073 100644 (file)
@@ -60,6 +60,8 @@ and module_kind =
   | Module_apply of module_kind * module_kind
   | Module_with of module_type_kind * string
   | Module_constraint of module_kind * module_type_kind
+  | Module_typeof of string (** by now only the code of the module expression *)
+  | Module_unpack of string * module_type_alias (** code of the expression and module type alias *)
 
 (** Representation of a module. *)
 and t_module = {
@@ -87,6 +89,7 @@ and module_type_kind =
   | Module_type_functor of module_parameter * module_type_kind
   | Module_type_alias of module_type_alias (** complete name and corresponding module type if we found it *)
   | Module_type_with of module_type_kind * string (** the module type kind and the code of the with constraint *)
+  | Module_type_typeof of string (** by now only the code of the module expression *)
 
 (** Representation of a module type. *)
 and t_module_type = {
@@ -243,6 +246,8 @@ let rec module_elements ?(trans=true) m =
             m_code_intf = None ;
             m_text_only = false ;
           }
+    | Module_typeof _ -> []
+    | Module_unpack _ -> []
 (*
    module_type_elements ~trans: trans
    { mt_name = "" ; mt_info = None ; mt_type = None ;
@@ -271,6 +276,7 @@ and module_type_elements ?(trans=true) mt =
           | Some mt -> module_type_elements mt
         else
           []
+  | Some (Module_type_typeof _) -> []
   in
   iter_kind mt.mt_kind
 
@@ -358,7 +364,8 @@ let rec module_type_parameters ?(trans=true) mt =
           []
     | Some (Module_type_struct _) ->
         []
-    | None ->
+    | Some (Module_type_typeof _) -> []
+      | None ->
         []
   in
   iter mt.mt_kind
@@ -398,8 +405,9 @@ and module_parameters ?(trans=true) m =
             mt_loc = Odoc_types.dummy_loc }
     | Module_struct _
     | Module_apply _
-    | Module_with _ ->
-        []
+    | Module_with _
+    | Module_typeof _
+    | Module_unpack _ -> []
   in
   iter m.m_kind
 
@@ -426,6 +434,7 @@ let rec module_type_is_functor mt =
     | Some (Module_type_with (k, _)) ->
         iter (Some k)
     | Some (Module_type_struct _)
+    | Some (Module_type_typeof _)
     | None -> false
   in
   iter mt.mt_kind
index 67a0b9f6c98e35963e14cb79aac0bc96615704a9..34a71e84e9d5d1cfa9c5e7db547db6b7077914c4 100644 (file)
@@ -791,50 +791,27 @@ module Analyser =
             let (maybe_more, mods) = f ~first: true 0 pos_start_ele decls in
             (maybe_more, new_env, mods)
 
-        | Parsetree.Psig_modtype (name, Parsetree.Pmodtype_abstract) ->
-            let sig_mtype =
-              try Signature_search.search_module_type table name
-              with Not_found ->
-                raise (Failure (Odoc_messages.module_type_not_found current_module_name name))
-            in
-            let complete_name = Name.concat current_module_name name in
-            let mt =
-              {
-                mt_name = complete_name ;
-                mt_info = comment_opt ;
-                mt_type = sig_mtype ;
-                mt_is_interface = true ;
-                mt_file = !file_name ;
-                mt_kind = None ;
-                mt_loc = { loc_impl = None ; loc_inter = Some (!file_name, pos_start_ele) } ;
-              }
-            in
-            let (maybe_more, info_after_opt) =
-              My_ir.just_after_special
-                !file_name
-                (get_string_of_file pos_end_ele pos_limit)
-            in
-            mt.mt_info <- merge_infos mt.mt_info info_after_opt ;
-            let new_env = Odoc_env.add_module_type env mt.mt_name in
-            (maybe_more, new_env, [ Element_module_type mt ])
-
-        | Parsetree.Psig_modtype (name, Parsetree.Pmodtype_manifest module_type) ->
+        | Parsetree.Psig_modtype (name, pmodtype_decl) ->
             let complete_name = Name.concat current_module_name name in
-            let sig_mtype_opt =
+            let sig_mtype =
               try Signature_search.search_module_type table name
               with Not_found ->
                 raise (Failure (Odoc_messages.module_type_not_found current_module_name name))
             in
             let module_type_kind =
-              match sig_mtype_opt with
-              | Some sig_mtype -> Some (analyse_module_type_kind env complete_name module_type sig_mtype)
-              | None -> None
+              match pmodtype_decl with
+                Parsetree.Pmodtype_abstract -> None
+              | Parsetree.Pmodtype_manifest module_type ->
+                match sig_mtype with
+                | Some sig_mtype -> Some (analyse_module_type_kind env complete_name module_type sig_mtype)
+                | None -> None
             in
+
             let mt =
               {
                 mt_name = complete_name ;
                 mt_info = comment_opt ;
-                mt_type = sig_mtype_opt ;
+                mt_type = sig_mtype ;
                 mt_is_interface = true ;
                 mt_file = !file_name ;
                 mt_kind = module_type_kind ;
@@ -849,7 +826,7 @@ module Analyser =
             mt.mt_info <- merge_infos mt.mt_info info_after_opt ;
             let new_env = Odoc_env.add_module_type env mt.mt_name in
             let new_env2 =
-              match sig_mtype_opt with (* A VOIR : cela peut-il être Tmty_ident ? dans ce cas, on aurait pas la signature *)
+              match sig_mtype with (* A VOIR : cela peut-il être Tmty_ident ? dans ce cas, on aurait pas la signature *)
                 Some (Types.Tmty_signature s) -> Odoc_env.add_signature new_env mt.mt_name ~rel: (Name.simple mt.mt_name) s
               | _ -> new_env
             in
@@ -865,10 +842,12 @@ module Analyser =
                   "??"
               | Parsetree.Pmty_with (mt, _) ->
                   f mt.Parsetree.pmty_desc
-              | Parsetree.Pmty_typeof _ -> (* TODO *)
-                  "??"
+              | Parsetree.Pmty_typeof mexpr ->
+                  match mexpr.Parsetree.pmod_desc with
+                    Parsetree.Pmod_ident longident -> Name.from_longident longident
+                  | _ -> "??"
             in
-            let name = (f module_type.Parsetree.pmty_desc) in
+            let name = f module_type.Parsetree.pmty_desc in
             let full_name = Odoc_env.full_module_or_module_type_name env name in
             let im =
               {
@@ -1096,7 +1075,10 @@ module Analyser =
           )
 
       | Parsetree.Pmty_typeof module_expr ->
-          assert false                  (* TODO *)
+          let loc_start = module_expr.Parsetree.pmod_loc.Location.loc_start.Lexing.pos_cnum in
+          let loc_end = module_expr.Parsetree.pmod_loc.Location.loc_end.Lexing.pos_cnum in
+          let s = get_string_of_file loc_start loc_end in
+          Module_type_typeof s
 
     (** analyse of a Parsetree.module_type and a Types.module_type.*)
     and analyse_module_kind env current_module_name module_type sig_module_type =
@@ -1162,7 +1144,10 @@ module Analyser =
            Module_with (k, s)
           )
       | Parsetree.Pmty_typeof module_expr ->
-          assert false                  (* TODO *)
+          let loc_start = module_expr.Parsetree.pmod_loc.Location.loc_start.Lexing.pos_cnum in
+          let loc_end = module_expr.Parsetree.pmod_loc.Location.loc_end.Lexing.pos_cnum in
+          let s = get_string_of_file loc_start loc_end in
+          Module_typeof s
 
     (** Analyse of a Parsetree.class_type and a Types.class_type to return a couple
        (class parameters, class_kind).*)
index 322ed44119272686a7e37cd867b15af11ff9ddbc..a3db5bd9baf6bb1b0cac3621baaec535461cf8c4 100644 (file)
@@ -543,6 +543,19 @@ class virtual to_text =
           [Code " -> "] @
           (self#text_of_module_kind ~with_def_syntax: false k)
 
+      | Module_typeof s ->
+          let code = Printf.sprintf "%smodule type of %s"
+            (if with_def_syntax then " : " else "")
+            s
+          in
+          [Code code]
+      | Module_unpack (code, _) ->
+          let code = Printf.sprintf "%s%s"
+            (if with_def_syntax then " : " else "")
+            code
+          in
+          [Code code]
+
     (** Return html code for a [module_type_kind].*)
     method text_of_module_type_kind ?(with_def_syntax=true) tk =
       match tk with
@@ -570,5 +583,9 @@ class virtual to_text =
                  | Some mt -> mt.mt_name))
           ]
 
-
+      | Odoc_module.Module_type_typeof s ->
+          let code = Printf.sprintf "%smodule type of %s"
+            (if with_def_syntax then " = " else "") s
+          in
+          [ Code code ]
   end
index 11e339d33ba602d827f83d15b2407defddb97781..5026d55ef4918ce3917fb0c64c50fbff33d89f4c 100644 (file)
@@ -1,32 +1,21 @@
 bigarray_stubs.o: bigarray_stubs.c ../../byterun/alloc.h \
-  ../../byterun/misc.h ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/mlvalues.h \
-  ../../byterun/config.h ../../byterun/misc.h bigarray.h \
-  ../../byterun/custom.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/intext.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/io.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fix_code.h \
-  ../../byterun/config.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/memory.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h
+ ../../byterun/misc.h ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h bigarray.h \
+ ../../byterun/config.h ../../byterun/mlvalues.h ../../byterun/custom.h \
+ ../../byterun/fail.h ../../byterun/intext.h ../../byterun/io.h \
+ ../../byterun/fix_code.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h
 mmap_unix.o: mmap_unix.c bigarray.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/mlvalues.h ../../byterun/config.h ../../byterun/misc.h \
-  ../../byterun/config.h ../../byterun/custom.h ../../byterun/mlvalues.h \
-  ../../byterun/fail.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/io.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/sys.h ../../byterun/misc.h
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/mlvalues.h ../../byterun/config.h ../../byterun/misc.h \
+ ../../byterun/custom.h ../../byterun/mlvalues.h ../../byterun/fail.h \
+ ../../byterun/io.h ../../byterun/sys.h
 mmap_win32.o: mmap_win32.c bigarray.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/mlvalues.h ../../byterun/config.h ../../byterun/misc.h \
-  ../../byterun/config.h ../../byterun/alloc.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/custom.h \
-  ../../byterun/mlvalues.h ../../byterun/fail.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/sys.h ../../byterun/misc.h \
-  ../unix/unixsupport.h
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/mlvalues.h ../../byterun/config.h ../../byterun/misc.h \
+ ../../byterun/alloc.h ../../byterun/mlvalues.h ../../byterun/custom.h \
+ ../../byterun/fail.h ../../byterun/sys.h ../unix/unixsupport.h
 bigarray.cmi:
 bigarray.cmo: bigarray.cmi
 bigarray.cmx: bigarray.cmi
diff --git a/otherlibs/bigarray/dllbigarray.dlib b/otherlibs/bigarray/dllbigarray.dlib
deleted file mode 100644 (file)
index 5ab8117..0000000
+++ /dev/null
@@ -1 +0,0 @@
-bigarray_stubs.d.o mmap_win32.d.o
index 31398124f13c6656e43ebe572a0694a35fa34e07..e71de3418ecab2c8eef3c4c4c1fe2781a6597443 100644 (file)
-color.o: color.c libgraph.h \
-  \
-  \
-  \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h
-draw.o: draw.c libgraph.h \
-  \
-  \
-  \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h
-dump_img.o: dump_img.c libgraph.h \
-  \
-  \
-  \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h image.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h
-events.o: events.c libgraph.h \
-  \
-  \
-  \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h
-fill.o: fill.c libgraph.h \
-  \
-  \
-  \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h
-image.o: image.c libgraph.h \
-  \
-  \
-  \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h image.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/custom.h \
-  ../../byterun/compatibility.h ../../byterun/mlvalues.h
-make_img.o: make_img.c libgraph.h \
-  \
-  \
-  \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h image.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h
-open.o: open.c libgraph.h \
-  \
-  \
-  \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/callback.h \
-  ../../byterun/compatibility.h ../../byterun/mlvalues.h \
-  ../../byterun/fail.h ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h
-point_col.o: point_col.c libgraph.h \
-  \
-  \
-  \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h
-sound.o: sound.c libgraph.h \
-  \
-  \
-  \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h
-subwindow.o: subwindow.c libgraph.h \
-  \
-  \
-  \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h
-text.o: text.c libgraph.h \
-  \
-  \
-  \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h
+color.o: color.c libgraph.h ../../byterun/mlvalues.h \
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h
+draw.o: draw.c libgraph.h ../../byterun/mlvalues.h \
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h
+dump_img.o: dump_img.c libgraph.h ../../byterun/mlvalues.h \
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h image.h ../../byterun/alloc.h \
+ ../../byterun/mlvalues.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h
+events.o: events.c libgraph.h ../../byterun/mlvalues.h \
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/signals.h
+fill.o: fill.c libgraph.h ../../byterun/mlvalues.h \
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/mlvalues.h ../../byterun/major_gc.h \
+ ../../byterun/freelist.h ../../byterun/minor_gc.h
+image.o: image.c libgraph.h ../../byterun/mlvalues.h \
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h image.h ../../byterun/alloc.h \
+ ../../byterun/mlvalues.h ../../byterun/custom.h
+make_img.o: make_img.c libgraph.h ../../byterun/mlvalues.h \
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h image.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/mlvalues.h ../../byterun/major_gc.h \
+ ../../byterun/freelist.h ../../byterun/minor_gc.h
+open.o: open.c libgraph.h ../../byterun/mlvalues.h \
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/callback.h ../../byterun/fail.h ../../byterun/memory.h \
+ ../../byterun/gc.h ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h
+point_col.o: point_col.c libgraph.h ../../byterun/mlvalues.h \
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h
+sound.o: sound.c libgraph.h ../../byterun/mlvalues.h \
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h
+subwindow.o: subwindow.c libgraph.h ../../byterun/mlvalues.h \
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h
+text.o: text.c libgraph.h ../../byterun/mlvalues.h \
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h
 graphics.cmi:
 graphicsX11.cmi:
 graphics.cmo: graphics.cmi
index 5530c4bc3c78de447bd64a710c7694ddfb840be5..bfd028c0ad9333e3e4060dee19105a1c250c0da3 100644 (file)
@@ -1,6 +1,6 @@
 bng.o: bng.c bng.h ../../byterun/config.h ../../byterun/../config/m.h \
 ../../byterun/../config/s.h ../../byterun/compatibility.h bng_ia32.c \
 bng_digit.c
../../byterun/../config/s.h ../../byterun/compatibility.h bng_amd64.c \
+ bng_digit.c
 bng_alpha.o: bng_alpha.c
 bng_amd64.o: bng_amd64.c
 bng_digit.o: bng_digit.c
@@ -9,24 +9,14 @@ bng_mips.o: bng_mips.c
 bng_ppc.o: bng_ppc.c
 bng_sparc.o: bng_sparc.c
 nat_stubs.o: nat_stubs.c ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/misc.h ../../byterun/custom.h \
-  ../../byterun/compatibility.h ../../byterun/mlvalues.h \
-  ../../byterun/intext.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/io.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fix_code.h \
-  ../../byterun/config.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/fail.h ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h bng.h nat.h
+ ../../byterun/compatibility.h ../../byterun/misc.h \
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/config.h ../../byterun/custom.h ../../byterun/intext.h \
+ ../../byterun/io.h ../../byterun/fix_code.h ../../byterun/fail.h \
+ ../../byterun/memory.h ../../byterun/gc.h ../../byterun/major_gc.h \
+ ../../byterun/freelist.h ../../byterun/minor_gc.h \
+ ../../byterun/mlvalues.h bng.h nat.h
 arith_flags.cmi:
 arith_status.cmi:
 big_int.cmi: nat.cmi
index b986460cca051a4836ada7402b79fcfa382c8852..16103b2b009587b940b80180bdb9ed675b8806df 100644 (file)
@@ -25,7 +25,7 @@ COBJS=bng.$(O) nat_stubs.$(O)
 include ../Makefile.nt
 
 clean::
-       cd test ; $(MAKEREC) clean
+       rm -f *~
 
 bng.$(O): bng.h bng_digit.c \
        bng_alpha.c bng_amd64.c bng_ia32.c bng_mips.c bng_ppc.c bng_sparc.c
index 8342d52d2723975aa22f89534f3ca0e8b5ffeab4..6b6015185d0bde48c9e6cb221c2551614c35a8d4 100644 (file)
@@ -682,8 +682,8 @@ let shift_left_big_int bi n =
 
 (* Shift right by N bits (rounds toward zero) *)
 
-let shift_right_big_int bi n =
-  if n < 0 then invalid_arg "shift_right_big_int"
+let shift_right_towards_zero_big_int bi n =
+  if n < 0 then invalid_arg "shift_right_towards_zero_big_int"
   else if n = 0 then bi
   else if bi.sign = 0 then bi
   else begin
@@ -702,17 +702,6 @@ let shift_right_big_int bi n =
     end
   end
 
-(*************************************
-(* Compute 2^n *)
-
-let two_power_big_int n =
-  if n < 0 then invalid_arg "two_power_big_int";
-  let size_res = (n + length_of_digit - 1) / length_of_digit in
-  let res = make_nat n in
-  set_digit_nat_native res (n / length_of_digit)
-                           (Nativeint.shift_left 1n (n mod length_of_digit));
-  { sign = 1; abs_value = res }
-
 (* Compute 2^n - 1 *)
 
 let two_power_m1_big_int n =
@@ -720,20 +709,19 @@ let two_power_m1_big_int n =
   else if n = 0 then zero_big_int
   else begin
     let size_res = (n + length_of_digit - 1) / length_of_digit in
-    let res = make_nat n in
+    let res = make_nat size_res in
     set_digit_nat_native res (n / length_of_digit)
                              (Nativeint.shift_left 1n (n mod length_of_digit));
     ignore (decr_nat res 0 size_res 0);
     { sign = 1; abs_value = res }
   end
 
-(* Shift right logical by N bits (rounds toward minus infinity) *)
+(* Shift right by N bits (rounds toward minus infinity) *)
 
-let lsr_big_int bi n =
-  if n < 0 then invalid_arg "asr_big_int"
-  else if bi.sign >= 0 then asr_big_int bi n
-  else asr_big_int (sub_big_int bi (two_power_m1_big_int n)) n
-**************************)
+let shift_right_big_int bi n =
+  if n < 0 then invalid_arg "shift_right_big_int"
+  else if bi.sign >= 0 then shift_right_towards_zero_big_int bi n
+  else shift_right_towards_zero_big_int (sub_big_int bi (two_power_m1_big_int n)) n
 
 (* Extract N bits starting at ofs.
    Treats bi in two's complement.
index 70c4c73df1b3f47677df462d33d6981667e06fd8..2ac7b7eb6f2e665ae52644c669fba4f774da432e 100644 (file)
@@ -168,8 +168,12 @@ val shift_left_big_int : big_int -> int -> big_int
             Equivalent to multiplication by [2^n]. *)
 val shift_right_big_int : big_int -> int -> big_int
         (** [shift_right_big_int b n] returns [b] shifted right by [n] bits.
-            The shift is performed on the absolute value of [b].
-            The result has the same sign as [b].
+            Equivalent to division by [2^n] with the result being
+            rounded towards minus infinity. *)
+val shift_right_towards_zero_big_int : big_int -> int -> big_int
+        (** [shift_right_towards_zero_big_int b n] returns [b] shifted
+            right by [n] bits.  The shift is performed on the absolute
+            value of [b], and the result has the same sign as [b].
             Equivalent to division by [2^n] with the result being
             rounded towards zero. *)
 val extract_big_int : big_int -> int -> int -> big_int
index 20012aa53d00f3f8ab3a812b9be5656ee23b324f..168b44ad3dfa710bed4b5af552c6e3a120dc09d1 100644 (file)
@@ -92,7 +92,7 @@
 }
 #endif
 
-#define BngLowHalf(d) ((d) & ((1L << BNG_BITS_PER_HALF_DIGIT) - 1))
+#define BngLowHalf(d) ((d) & (((bngdigit)1 << BNG_BITS_PER_HALF_DIGIT) - 1))
 #define BngHighHalf(d) ((d) >> BNG_BITS_PER_HALF_DIGIT)
 
 #ifndef BngMult
diff --git a/otherlibs/num/dllnums.dlib b/otherlibs/num/dllnums.dlib
deleted file mode 100644 (file)
index e54aa8e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-bng.d.o nat_stubs.d.o
index 83d7009852a9e60e3c3a90a15161a30dee73a9db..c9eb99514b1486cea26d44e47f841d0c3193708e 100644 (file)
@@ -1,17 +1,9 @@
 strstubs.o: strstubs.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/memory.h ../../byterun/gc.h ../../byterun/major_gc.h \
+ ../../byterun/freelist.h ../../byterun/minor_gc.h ../../byterun/fail.h
 str.cmi:
 str.cmo: str.cmi
 str.cmx: str.cmi
diff --git a/otherlibs/str/dllstr.dlib b/otherlibs/str/dllstr.dlib
deleted file mode 100644 (file)
index 0c34626..0000000
+++ /dev/null
@@ -1 +0,0 @@
-strstubs.d.o
index 741eaa56c6a510d4e57309170435ed322da6c0a2..f3f760acb93af36a90f7d6762052687cb3f9a5b8 100644 (file)
@@ -29,7 +29,7 @@ module Charset =
   struct
     type t = string (* of length 32 *)
 
-    let empty = String.make 32 '\000'
+    (*let empty = String.make 32 '\000'*)
     let full = String.make 32 '\255'
 
     let make_empty () = String.make 32 '\000'
@@ -44,9 +44,9 @@ module Charset =
     let singleton c =
       let s = make_empty () in add s c; s
 
-    let range c1 c2 =
+    (*let range c1 c2 =
       let s = make_empty () in add_range s c1 c2; s
-
+    *)
     let complement s =
       let r = String.create 32 in
       for i = 0 to 31 do
index 43ac57818840c5379169f12f013d1e8103530e7d..dc859aa81f944f1980ed75dd397ad053c196c62b 100644 (file)
@@ -1,27 +1,14 @@
-posix.o: posix.c ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/misc.h ../../byterun/backtrace.h \
-  ../../byterun/mlvalues.h ../../byterun/callback.h \
-  ../../byterun/compatibility.h ../../byterun/mlvalues.h \
-  ../../byterun/custom.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/io.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/printexc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/roots.h \
-  ../../byterun/misc.h ../../byterun/memory.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/stacks.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h ../../byterun/sys.h \
-  ../../byterun/misc.h
+st_stubs.o: st_stubs.c ../../byterun/alloc.h \
+ ../../byterun/compatibility.h ../../byterun/misc.h \
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/backtrace.h ../../byterun/callback.h \
+ ../../byterun/custom.h ../../byterun/fail.h ../../byterun/io.h \
+ ../../byterun/memory.h ../../byterun/gc.h ../../byterun/major_gc.h \
+ ../../byterun/freelist.h ../../byterun/minor_gc.h ../../byterun/misc.h \
+ ../../byterun/mlvalues.h ../../byterun/printexc.h ../../byterun/roots.h \
+ ../../byterun/memory.h ../../byterun/signals.h ../../byterun/stacks.h \
+ ../../byterun/sys.h threads.h st_posix.h
 condition.cmi: mutex.cmi
 event.cmi:
 mutex.cmi:
@@ -37,7 +24,3 @@ thread.cmo: thread.cmi
 thread.cmx: thread.cmi
 threadUnix.cmo: thread.cmi threadUnix.cmi
 threadUnix.cmx: thread.cmx threadUnix.cmi
-thread_posix.cmo:
-thread_posix.cmx:
-thread_win32.cmo:
-thread_win32.cmx:
index b74f9bc7503105827e1742d4c0a05ea88e497e0a..f5c80c0e2dbf98eb27f85a769a1402bdadfbad5e 100644 (file)
@@ -20,13 +20,11 @@ CAMLOPT=../../ocamlcompopt.sh -I ../unix
 MKLIB=../../boot/ocamlrun ../../tools/ocamlmklib
 COMPFLAGS=-warn-error A -g
 
-BYTECODE_C_OBJS=posix_b.o
-NATIVECODE_C_OBJS=posix_n.o
+BYTECODE_C_OBJS=st_stubs_b.o
+NATIVECODE_C_OBJS=st_stubs_n.o
 
 THREAD_OBJS= thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo
 
-GENFILES=thread.ml
-
 all: libthreads.a threads.cma
 
 allopt: libthreadsnat.a threads.cmxa
@@ -34,19 +32,19 @@ allopt: libthreadsnat.a threads.cmxa
 libthreads.a: $(BYTECODE_C_OBJS)
        $(MKLIB) -o threads $(BYTECODE_C_OBJS)
 
-posix_b.o: posix.c
+st_stubs_b.o: st_stubs.c st_posix.h
        $(BYTECC) -O -I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) \
-          -c posix.c
-       mv posix.o posix_b.o
+          -c st_stubs.c
+       mv st_stubs.o st_stubs_b.o
 
 # Dynamic linking with -lpthread is risky on many platforms, so
 # do not create a shared object for libthreadsnat.
 libthreadsnat.a: $(NATIVECODE_C_OBJS)
        $(AR) rc libthreadsnat.a $(NATIVECODE_C_OBJS)
 
-posix_n.o: posix.c
-       $(NATIVECC) -O -I../../asmrun -I../../byterun $(NATIVECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) -c posix.c
-       mv posix.o posix_n.o
+st_stubs_n.o: st_stubs.c st_posix.h
+       $(NATIVECC) -O -I../../asmrun -I../../byterun $(NATIVECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) -c st_stubs.c
+       mv st_stubs.o st_stubs_n.o
 
 threads.cma: $(THREAD_OBJS)
        $(MKLIB) -ocamlc '$(CAMLC)' -o threads $(THREAD_OBJS) \
@@ -65,15 +63,11 @@ threads.cmxa: $(THREAD_OBJS:.cmo=.cmx)
 
 $(THREAD_OBJS:.cmo=.cmx): ../../ocamlopt
 
-thread.ml: thread_posix.ml
-       ln -s thread_posix.ml thread.ml
-
 partialclean:
        rm -f *.cm*
 
 clean: partialclean
        rm -f *.o *.a *.so
-       rm -f $(GENFILES)
 
 install:
        if test -f dllthreads.so; then cp dllthreads.so $(STUBLIBDIR)/dllthreads.so; fi
@@ -83,6 +77,7 @@ install:
        cp $(THREAD_OBJS:.cmo=.cmi) threads.cma $(LIBDIR)/threads
        rm -f $(LIBDIR)/threads/stdlib.cma
        cp thread.mli mutex.mli condition.mli event.mli threadUnix.mli $(LIBDIR)
+       cp threads.h $(LIBDIR)/caml/threads.h
 
 installopt:
        cp libthreadsnat.a $(LIBDIR)/libthreadsnat.a
index a5380134be2b08af3f5adcc1d1cba4b83c6753e4..8c559e0b6d78850a10bfcb1740f50db5152af07a 100644 (file)
@@ -24,10 +24,8 @@ CFLAGS=-I../../byterun $(EXTRACFLAGS)
 
 CAMLOBJS=thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo
 CMIFILES=$(CAMLOBJS:.cmo=.cmi)
-COBJS=win32_b.$(O)
-COBJS_NAT=win32_n.$(O)
-
-GENFILES=thread.ml
+COBJS=st_stubs_b.$(O)
+COBJS_NAT=st_stubs_n.$(O)
 
 LIBNAME=threads
 
@@ -41,9 +39,9 @@ $(LIBNAME).cma: $(CAMLOBJS)
 lib$(LIBNAME).$(A): $(COBJS)
        $(MKLIB) -o $(LIBNAME) $(COBJS) $(LDOPTS)
 
-win32_b.$(O): win32.c
-       $(BYTECC) $(BYTECCCOMPOPTS) $(CFLAGS) -c win32.c
-       mv win32.$(O) win32_b.$(O)
+st_stubs_b.$(O): st_stubs.c st_win32.h
+       $(BYTECC) $(BYTECCCOMPOPTS) $(CFLAGS) -c st_stubs.c
+       mv st_stubs.$(O) st_stubs_b.$(O)
 
 
 
@@ -58,21 +56,17 @@ $(LIBNAME).cmxs: $(LIBNAME).cmxa lib$(LIBNAME)nat.$(A)
 lib$(LIBNAME)nat.$(A): $(COBJS_NAT)
        $(MKLIB) -o $(LIBNAME)nat $(COBJS_NAT) $(LDOPTS)
 
-win32_n.$(O): win32.c
-       $(NATIVECC) -DNATIVE_CODE -O -I../../asmrun -I../../byterun $(NATIVECCCOMPOPTS) -c win32.c
-       mv win32.$(O) win32_n.$(O)
+st_stubs_n.$(O): st_stubs.c st_win32.h
+       $(NATIVECC) -DNATIVE_CODE -I../../asmrun -I../../byterun $(NATIVECCCOMPOPTS) -c st_stubs.c
+       mv st_stubs.$(O) st_stubs_n.$(O)
 
 $(CAMLOBJS:.cmo=.cmx): ../../ocamlopt
 
-thread.ml: thread_win32.ml
-       cp thread_win32.ml thread.ml
-
 partialclean:
        rm -f *.cm*
 
 clean: partialclean
        rm -f *.dll *.$(A) *.$(O)
-       rm -f $(GENFILES)
 
 install:
        cp dllthreads.dll $(STUBLIBDIR)/dllthreads.dll
@@ -80,6 +74,7 @@ install:
        mkdir -p $(LIBDIR)/threads
        cp $(CMIFILES) threads.cma $(LIBDIR)/threads
        rm -f $(LIBDIR)/threads/stdlib.cma
+       cp threads.h $(LIBDIR)/caml/threads.h
 
 installopt:
        cp libthreadsnat.$(A) $(LIBDIR)/libthreadsnat.$(A)
diff --git a/otherlibs/systhreads/dllthreads.dlib b/otherlibs/systhreads/dllthreads.dlib
deleted file mode 100644 (file)
index 40686f6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-win32_b.d.o
index 111ec5ae2d43ae07f71f45176c000ff71d5e9f2e..a0582d41fad8101ba0123072bd5aa1cf2014c8ef 100644 (file)
@@ -1 +1 @@
-posix_b.o
+st_stubs_b.o
diff --git a/otherlibs/systhreads/libthreadswin32.clib b/otherlibs/systhreads/libthreadswin32.clib
deleted file mode 100644 (file)
index 51b11a2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-win32_b.o
diff --git a/otherlibs/systhreads/posix.c b/otherlibs/systhreads/posix.c
deleted file mode 100644 (file)
index f20f49a..0000000
+++ /dev/null
@@ -1,929 +0,0 @@
-/***********************************************************************/
-/*                                                                     */
-/*                             Objective Caml                          */
-/*                                                                     */
-/*         Xavier Leroy and Damien Doligez, INRIA Rocquencourt         */
-/*                                                                     */
-/*  Copyright 1995 Institut National de Recherche en Informatique et   */
-/*  en Automatique.  All rights reserved.  This file is distributed    */
-/*  under the terms of the GNU Library General Public License, with    */
-/*  the special exception on linking described in file ../../LICENSE.  */
-/*                                                                     */
-/***********************************************************************/
-
-/* $Id$ */
-
-/* Thread interface for POSIX 1003.1c threads */
-
-#include <errno.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <pthread.h>
-#ifdef __sun
-#define _POSIX_PTHREAD_SEMANTICS
-#endif
-#include <signal.h>
-#include <sys/time.h>
-#ifdef __linux__
-#include <unistd.h>
-#endif
-#include "alloc.h"
-#include "backtrace.h"
-#include "callback.h"
-#include "custom.h"
-#include "fail.h"
-#include "io.h"
-#include "memory.h"
-#include "misc.h"
-#include "mlvalues.h"
-#include "printexc.h"
-#include "roots.h"
-#include "signals.h"
-#ifdef NATIVE_CODE
-#include "stack.h"
-#else
-#include "stacks.h"
-#endif
-#include "sys.h"
-
-/* Initial size of stack when a thread is created (4 Ko) */
-#define Thread_stack_size (Stack_size / 4)
-
-/* Max computation time before rescheduling, in microseconds (50ms) */
-#define Thread_timeout 50000
-
-/* The ML value describing a thread (heap-allocated) */
-
-struct caml_thread_descr {
-  value ident;                  /* Unique integer ID */
-  value start_closure;          /* The closure to start this thread */
-  value terminated;             /* Mutex held while the thread is running */
-};
-
-#define Ident(v) (((struct caml_thread_descr *)(v))->ident)
-#define Start_closure(v) (((struct caml_thread_descr *)(v))->start_closure)
-#define Terminated(v) (((struct caml_thread_descr *)(v))->terminated)
-
-/* The infos on threads (allocated via malloc()) */
-
-struct caml_thread_struct {
-  pthread_t pthread;            /* The Posix thread id */
-  value descr;                  /* The heap-allocated descriptor (root) */
-  struct caml_thread_struct * next;  /* Double linking of running threads */
-  struct caml_thread_struct * prev;
-#ifdef NATIVE_CODE
-  char * bottom_of_stack;       /* Saved value of caml_bottom_of_stack */
-  uintnat last_retaddr;         /* Saved value of caml_last_return_address */
-  value * gc_regs;              /* Saved value of caml_gc_regs */
-  char * exception_pointer;     /* Saved value of caml_exception_pointer */
-  struct caml__roots_block * local_roots; /* Saved value of local_roots */
-  struct longjmp_buffer * exit_buf; /* For thread exit */
-#else
-  value * stack_low;            /* The execution stack for this thread */
-  value * stack_high;
-  value * stack_threshold;
-  value * sp;                   /* Saved value of extern_sp for this thread */
-  value * trapsp;               /* Saved value of trapsp for this thread */
-  struct caml__roots_block * local_roots; /* Saved value of local_roots */
-  struct longjmp_buffer * external_raise; /* Saved external_raise */
-#endif
-  int backtrace_pos;            /* Saved backtrace_pos */
-  code_t * backtrace_buffer;    /* Saved backtrace_buffer */
-  value backtrace_last_exn;     /* Saved backtrace_last_exn (root) */
-};
-
-typedef struct caml_thread_struct * caml_thread_t;
-
-/* The descriptor for the currently executing thread */
-static caml_thread_t curr_thread = NULL;
-
-/* Track whether one thread is running Caml code.  There can be
-   at most one such thread at any time. */
-static volatile int caml_runtime_busy = 1;
-
-/* Number of threads waiting to run Caml code. */
-static volatile int caml_runtime_waiters = 0;
-
-/* Mutex that protects the two variables above. */
-static pthread_mutex_t caml_runtime_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-/* Condition signaled when caml_runtime_busy becomes 0 */
-static pthread_cond_t caml_runtime_is_free = PTHREAD_COND_INITIALIZER;
-
-/* Whether the ``tick'' thread is already running */
-static int caml_tick_thread_running = 0;
-
-/* The key used for storing the thread descriptor in the specific data
-   of the corresponding Posix thread. */
-static pthread_key_t thread_descriptor_key;
-
-/* The key used for unlocking I/O channels on exceptions */
-static pthread_key_t last_channel_locked_key;
-
-/* Identifier for next thread creation */
-static intnat thread_next_ident = 0;
-
-/* Forward declarations */
-value caml_threadstatus_new (void);
-void caml_threadstatus_terminate (value);
-int caml_threadstatus_wait (value);
-static void caml_pthread_check (int, char *);
-
-/* Imports for the native-code compiler */
-extern struct longjmp_buffer caml_termination_jmpbuf;
-extern void (*caml_termination_hook)(void *);
-
-/* Hook for scanning the stacks of the other threads */
-
-static void (*prev_scan_roots_hook) (scanning_action);
-
-static void caml_thread_scan_roots(scanning_action action)
-{
-  caml_thread_t th;
-
-  th = curr_thread;
-  do {
-    (*action)(th->descr, &th->descr);
-    (*action)(th->backtrace_last_exn, &th->backtrace_last_exn);
-    /* Don't rescan the stack of the current thread, it was done already */
-    if (th != curr_thread) {
-#ifdef NATIVE_CODE
-      if (th->bottom_of_stack != NULL)
-        do_local_roots(action, th->bottom_of_stack, th->last_retaddr,
-                       th->gc_regs, th->local_roots);
-#else
-      do_local_roots(action, th->sp, th->stack_high, th->local_roots);
-#endif
-    }
-    th = th->next;
-  } while (th != curr_thread);
-  /* Hook */
-  if (prev_scan_roots_hook != NULL) (*prev_scan_roots_hook)(action);
-}
-
-/* Hooks for enter_blocking_section and leave_blocking_section */
-
-static void caml_thread_enter_blocking_section(void)
-{
-  /* Save the stack-related global variables in the thread descriptor
-     of the current thread */
-#ifdef NATIVE_CODE
-  curr_thread->bottom_of_stack = caml_bottom_of_stack;
-  curr_thread->last_retaddr = caml_last_return_address;
-  curr_thread->gc_regs = caml_gc_regs;
-  curr_thread->exception_pointer = caml_exception_pointer;
-  curr_thread->local_roots = local_roots;
-#else
-  curr_thread->stack_low = stack_low;
-  curr_thread->stack_high = stack_high;
-  curr_thread->stack_threshold = stack_threshold;
-  curr_thread->sp = extern_sp;
-  curr_thread->trapsp = trapsp;
-  curr_thread->local_roots = local_roots;
-  curr_thread->external_raise = external_raise;
-#endif
-  curr_thread->backtrace_pos = backtrace_pos;
-  curr_thread->backtrace_buffer = backtrace_buffer;
-  curr_thread->backtrace_last_exn = backtrace_last_exn;
-  /* Tell other threads that the runtime is free */
-  pthread_mutex_lock(&caml_runtime_mutex);
-  caml_runtime_busy = 0;
-  pthread_mutex_unlock(&caml_runtime_mutex);
-  pthread_cond_signal(&caml_runtime_is_free);
-}
-
-static void caml_thread_leave_blocking_section(void)
-{
-  /* Wait until the runtime is free */
-  pthread_mutex_lock(&caml_runtime_mutex);
-  while (caml_runtime_busy) {
-    caml_runtime_waiters++;
-    pthread_cond_wait(&caml_runtime_is_free, &caml_runtime_mutex);
-    caml_runtime_waiters--;
-  }
-  caml_runtime_busy = 1;
-  pthread_mutex_unlock(&caml_runtime_mutex);
-  /* Update curr_thread to point to the thread descriptor corresponding
-     to the thread currently executing */
-  curr_thread = pthread_getspecific(thread_descriptor_key);
-  /* Restore the stack-related global variables */
-#ifdef NATIVE_CODE
-  caml_bottom_of_stack= curr_thread->bottom_of_stack;
-  caml_last_return_address = curr_thread->last_retaddr;
-  caml_gc_regs = curr_thread->gc_regs;
-  caml_exception_pointer = curr_thread->exception_pointer;
-  local_roots = curr_thread->local_roots;
-#else
-  stack_low = curr_thread->stack_low;
-  stack_high = curr_thread->stack_high;
-  stack_threshold = curr_thread->stack_threshold;
-  extern_sp = curr_thread->sp;
-  trapsp = curr_thread->trapsp;
-  local_roots = curr_thread->local_roots;
-  external_raise = curr_thread->external_raise;
-#endif
-  backtrace_pos = curr_thread->backtrace_pos;
-  backtrace_buffer = curr_thread->backtrace_buffer;
-  backtrace_last_exn = curr_thread->backtrace_last_exn;
-}
-
-static int caml_thread_try_leave_blocking_section(void)
-{
-  /* Disable immediate processing of signals (PR#3659).
-     try_leave_blocking_section always fails, forcing the signal to be
-     recorded and processed at the next leave_blocking_section or
-     polling. */
-  return 0;
-}
-
-/* Hooks for I/O locking */
-
-static void caml_io_mutex_free(struct channel *chan)
-{
-  pthread_mutex_t * mutex = chan->mutex;
-  if (mutex != NULL) {
-    pthread_mutex_destroy(mutex);
-    stat_free((char *) mutex);
-  }
-}
-
-static void caml_io_mutex_lock(struct channel *chan)
-{
-  if (chan->mutex == NULL) {
-    pthread_mutex_t * mutex =
-      (pthread_mutex_t *) stat_alloc(sizeof(pthread_mutex_t));
-    pthread_mutex_init(mutex, NULL);
-    chan->mutex = (void *) mutex;
-  }
-  /* PR#4351: first try to acquire mutex without releasing the master lock */
-  if (pthread_mutex_trylock(chan->mutex) == 0) {
-    pthread_setspecific(last_channel_locked_key, (void *) chan);
-    return;
-  }
-  /* If unsuccessful, block on mutex */
-  enter_blocking_section();
-  pthread_mutex_lock(chan->mutex);
-  /* Problem: if a signal occurs at this point,
-     and the signal handler raises an exception, we will not
-     unlock the mutex.  The alternative (doing the setspecific
-     before locking the mutex is also incorrect, since we could
-     then unlock a mutex that is unlocked or locked by someone else. */
-  pthread_setspecific(last_channel_locked_key, (void *) chan);
-  leave_blocking_section();
-}
-
-static void caml_io_mutex_unlock(struct channel *chan)
-{
-  pthread_mutex_unlock(chan->mutex);
-  pthread_setspecific(last_channel_locked_key, NULL);
-}
-
-static void caml_io_mutex_unlock_exn(void)
-{
-  struct channel * chan = pthread_getspecific(last_channel_locked_key);
-  if (chan != NULL) caml_io_mutex_unlock(chan);
-}
-
-/* The "tick" thread fakes a SIGVTALRM signal at regular intervals. */
-
-static void * caml_thread_tick(void * arg)
-{
-  struct timeval timeout;
-  sigset_t mask;
-#ifdef __linux__
-  int tickcount = 0;
-#endif
-
-  /* Block all signals so that we don't try to execute
-     a Caml signal handler */
-  sigfillset(&mask);
-  pthread_sigmask(SIG_BLOCK, &mask, NULL);
-  while(1) {
-    /* select() seems to be the most efficient way to suspend the
-       thread for sub-second intervals */
-    timeout.tv_sec = 0;
-    timeout.tv_usec = Thread_timeout;
-    select(0, NULL, NULL, NULL, &timeout);
-    /* This signal should never cause a callback, so don't go through
-       handle_signal(), tweak the global variable directly. */
-    caml_pending_signals[SIGVTALRM] = 1;
-    caml_signals_are_pending = 1;
-#ifdef NATIVE_CODE
-    young_limit = young_end;
-#else
-    something_to_do = 1;
-#endif
-#ifdef __linux__
-    /* Hack around LinuxThreads' non-standard signal handling:
-       if program is killed on a signal, e.g. SIGINT, the current
-       thread will not die on this signal (because of the signal blocking
-       above).  Hence, periodically check that the thread manager (our
-       parent process) still exists. */
-    tickcount++;
-    if (tickcount >= 2000000 / Thread_timeout) { /* every 2 secs approx */
-      tickcount = 0;
-      if (getppid() == 1) pthread_exit(NULL);
-    }
-#endif
-  }
-  return NULL;                  /* prevents compiler warning */
-}
-
-/* Reinitialize the thread machinery after a fork() (PR#4577) */
-
-static void caml_thread_reinitialize(void)
-{
-  caml_thread_t thr, next;
-  struct channel * chan;
-
-  /* Remove all other threads (now nonexistent)
-     from the doubly-linked list of threads */
-  thr = curr_thread->next;
-  while (thr != curr_thread) {
-    next = thr->next;
-    stat_free(thr);
-    thr = next;
-  }
-  curr_thread->next = curr_thread;
-  curr_thread->prev = curr_thread;
-  /* Reinitialize the master lock machinery,
-     just in case the fork happened while other threads were doing
-     leave_blocking_section */
-  pthread_mutex_init(&caml_runtime_mutex, NULL);
-  pthread_cond_init(&caml_runtime_is_free, NULL);
-  caml_runtime_waiters = 0;     /* no other thread is waiting for the RTS */
-  caml_runtime_busy = 1;        /* normally useless */
-  /* Tick thread is not currently running in child process, will be
-     re-created at next Thread.create */
-  caml_tick_thread_running = 0;
-  /* Reinitialize all IO mutexes */
-  for (chan = caml_all_opened_channels;
-       chan != NULL;
-       chan = chan->next) {
-    if (chan->mutex != NULL) pthread_mutex_init(chan->mutex, NULL);
-  }
-}
-
-/* Initialize the thread machinery */
-
-value caml_thread_initialize(value unit)   /* ML */
-{
-  value mu = Val_unit;
-  value descr;
-
-  /* Protect against repeated initialization (PR#1325) */
-  if (curr_thread != NULL) return Val_unit;
-  Begin_root (mu);
-    /* Initialize the keys */
-    pthread_key_create(&thread_descriptor_key, NULL);
-    pthread_key_create(&last_channel_locked_key, NULL);
-    /* Create and initialize the termination semaphore */
-    mu = caml_threadstatus_new();
-    /* Create a descriptor for the current thread */
-    descr = alloc_small(3, 0);
-    Ident(descr) = Val_long(thread_next_ident);
-    Start_closure(descr) = Val_unit;
-    Terminated(descr) = mu;
-    thread_next_ident++;
-    /* Create an info block for the current thread */
-    curr_thread =
-      (caml_thread_t) stat_alloc(sizeof(struct caml_thread_struct));
-    curr_thread->pthread = pthread_self();
-    curr_thread->descr = descr;
-    curr_thread->next = curr_thread;
-    curr_thread->prev = curr_thread;
-    curr_thread->backtrace_last_exn = Val_unit;
-#ifdef NATIVE_CODE
-    curr_thread->exit_buf = &caml_termination_jmpbuf;
-#endif
-    /* The stack-related fields will be filled in at the next
-       enter_blocking_section */
-    /* Associate the thread descriptor with the thread */
-    pthread_setspecific(thread_descriptor_key, (void *) curr_thread);
-    /* Set up the hooks */
-    prev_scan_roots_hook = scan_roots_hook;
-    scan_roots_hook = caml_thread_scan_roots;
-    enter_blocking_section_hook = caml_thread_enter_blocking_section;
-    leave_blocking_section_hook = caml_thread_leave_blocking_section;
-    try_leave_blocking_section_hook = caml_thread_try_leave_blocking_section;
-#ifdef NATIVE_CODE
-    caml_termination_hook = pthread_exit;
-#endif
-    caml_channel_mutex_free = caml_io_mutex_free;
-    caml_channel_mutex_lock = caml_io_mutex_lock;
-    caml_channel_mutex_unlock = caml_io_mutex_unlock;
-    caml_channel_mutex_unlock_exn = caml_io_mutex_unlock_exn;
-    /* Set up fork() to reinitialize the thread machinery in the child
-       (PR#4577) */
-    pthread_atfork(NULL, NULL, caml_thread_reinitialize);
-  End_roots();
-  return Val_unit;
-}
-
-/* Thread cleanup at termination */
-
-static void caml_thread_stop(void)
-{
-  caml_thread_t th = curr_thread;
-
-  /* Signal that the thread has terminated */
-  caml_threadstatus_terminate(Terminated(th->descr));
-  /* Remove th from the doubly-linked list of threads */
-  th->next->prev = th->prev;
-  th->prev->next = th->next;
-  /* Release the runtime system */
-  pthread_mutex_lock(&caml_runtime_mutex);
-  caml_runtime_busy = 0;
-  pthread_mutex_unlock(&caml_runtime_mutex);
-  pthread_cond_signal(&caml_runtime_is_free);
-#ifndef NATIVE_CODE
-  /* Free the memory resources */
-  stat_free(th->stack_low);
-#endif
-  if (th->backtrace_buffer != NULL) free(th->backtrace_buffer);
-  /* Free the thread descriptor */
-  stat_free(th);
-}
-
-/* Create a thread */
-
-static void * caml_thread_start(void * arg)
-{
-  caml_thread_t th = (caml_thread_t) arg;
-  value clos;
-#ifdef NATIVE_CODE
-  struct longjmp_buffer termination_buf;
-#endif
-
-  /* Associate the thread descriptor with the thread */
-  pthread_setspecific(thread_descriptor_key, (void *) th);
-  /* Acquire the global mutex and set up the stack variables */
-  leave_blocking_section();
-#ifdef NATIVE_CODE
-  /* Setup termination handler (for caml_thread_exit) */
-  if (sigsetjmp(termination_buf.buf, 0) == 0) {
-    th->exit_buf = &termination_buf;
-#endif
-    /* Callback the closure */
-    clos = Start_closure(th->descr);
-    modify(&(Start_closure(th->descr)), Val_unit);
-    callback_exn(clos, Val_unit);
-    caml_thread_stop();
-#ifdef NATIVE_CODE
-  }
-#endif
-  /* The thread now stops running */
-  return NULL;
-}
-
-value caml_thread_new(value clos)          /* ML */
-{
-  pthread_attr_t attr;
-  caml_thread_t th;
-  pthread_t tick_pthread;
-  value mu = Val_unit;
-  value descr;
-  int err;
-
-  Begin_roots2 (clos, mu)
-    /* Create and initialize the termination semaphore */
-    mu = caml_threadstatus_new();
-    /* Create a descriptor for the new thread */
-    descr = alloc_small(3, 0);
-    Ident(descr) = Val_long(thread_next_ident);
-    Start_closure(descr) = clos;
-    Terminated(descr) = mu;
-    thread_next_ident++;
-    /* Create an info block for the current thread */
-    th = (caml_thread_t) stat_alloc(sizeof(struct caml_thread_struct));
-    th->descr = descr;
-#ifdef NATIVE_CODE
-    th->bottom_of_stack = NULL;
-    th->exception_pointer = NULL;
-    th->local_roots = NULL;
-#else
-    /* Allocate the stacks */
-    th->stack_low = (value *) stat_alloc(Thread_stack_size);
-    th->stack_high = th->stack_low + Thread_stack_size / sizeof(value);
-    th->stack_threshold = th->stack_low + Stack_threshold / sizeof(value);
-    th->sp = th->stack_high;
-    th->trapsp = th->stack_high;
-    th->local_roots = NULL;
-    th->external_raise = NULL;
-#endif
-    th->backtrace_pos = 0;
-    th->backtrace_buffer = NULL;
-    th->backtrace_last_exn = Val_unit;
-    /* Add thread info block to the list of threads */
-    th->next = curr_thread->next;
-    th->prev = curr_thread;
-    curr_thread->next->prev = th;
-    curr_thread->next = th;
-    /* Create the new thread */
-    pthread_attr_init(&attr);
-    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-    err = pthread_create(&th->pthread, &attr, caml_thread_start, (void *) th);
-    if (err != 0) {
-      /* Creation failed, remove thread info block from list of threads */
-      th->next->prev = curr_thread;
-      curr_thread->next = th->next;
-#ifndef NATIVE_CODE
-      stat_free(th->stack_low);
-#endif
-      stat_free(th);
-      caml_pthread_check(err, "Thread.create");
-    }
-  End_roots();
-  /* Create the tick thread if not already done.
-     Because of PR#4666, we start the tick thread late, only when we create
-     the first additional thread in the current process*/
-  if (! caml_tick_thread_running) {
-    caml_tick_thread_running = 1;
-    pthread_attr_init(&attr);
-    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-    err = pthread_create(&tick_pthread, &attr, caml_thread_tick, NULL);
-    caml_pthread_check(err, "Thread.create");
-  }
-  return descr;
-}
-
-/* Return the current thread */
-
-value caml_thread_self(value unit)         /* ML */
-{
-  if (curr_thread == NULL) invalid_argument("Thread.self: not initialized");
-  return curr_thread->descr;
-}
-
-/* Return the identifier of a thread */
-
-value caml_thread_id(value th)          /* ML */
-{
-  return Ident(th);
-}
-
-/* Print uncaught exception and backtrace */
-
-value caml_thread_uncaught_exception(value exn)  /* ML */
-{
-  char * msg = format_caml_exception(exn);
-  fprintf(stderr, "Thread %d killed on uncaught exception %s\n",
-          Int_val(Ident(curr_thread->descr)), msg);
-  free(msg);
-  if (caml_backtrace_active) print_exception_backtrace();
-  fflush(stderr);
-  return Val_unit;
-}
-
-/* Terminate current thread */
-
-value caml_thread_exit(value unit)   /* ML */
-{
-#ifdef NATIVE_CODE
-  /* We cannot call pthread_exit here because on some systems this
-     raises a C++ exception, and ocamlopt-generated stack frames
-     cannot be unwound.  Instead, we longjmp to the thread creation
-     point (in caml_thread_start) or to the point in caml_main
-     where caml_termination_hook will be called. */
-  struct longjmp_buffer * exit_buf;
-  if (curr_thread == NULL) invalid_argument("Thread.exit: not initialized");
-  exit_buf = curr_thread->exit_buf;
-  caml_thread_stop();
-  siglongjmp(exit_buf->buf, 1);
-#else
-  /* No such problem in bytecode */
-  if (curr_thread == NULL) invalid_argument("Thread.exit: not initialized");
-  caml_thread_stop();
-  pthread_exit(NULL);
-#endif
-  return Val_unit;  /* not reached */
-}
-
-/* Allow re-scheduling */
-
-value caml_thread_yield(value unit)        /* ML */
-{
-  if (caml_runtime_waiters == 0) return Val_unit;
-  enter_blocking_section();
-#ifndef __linux__
-  /* sched_yield() doesn't do what we want in Linux 2.6 and up (PR#2663) */
-  sched_yield();
-#endif
-  leave_blocking_section();
-  return Val_unit;
-}
-
-/* Suspend the current thread until another thread terminates */
-
-value caml_thread_join(value th)          /* ML */
-{
-  int retcode = caml_threadstatus_wait(Terminated(th));
-  caml_pthread_check(retcode, "Thread.join");
-  return Val_unit;
-}
-
-/* Mutex operations */
-
-#define Mutex_val(v) (* ((pthread_mutex_t **) Data_custom_val(v)))
-#define Max_mutex_number 1000
-
-static void caml_mutex_finalize(value wrapper)
-{
-  pthread_mutex_t * mut = Mutex_val(wrapper);
-  pthread_mutex_destroy(mut);
-  stat_free(mut);
-}
-
-static int caml_mutex_condition_compare(value wrapper1, value wrapper2)
-{
-  pthread_mutex_t * mut1 = Mutex_val(wrapper1);
-  pthread_mutex_t * mut2 = Mutex_val(wrapper2);
-  return mut1 == mut2 ? 0 : mut1 < mut2 ? -1 : 1;
-}
-
-static struct custom_operations caml_mutex_ops = {
-  "_mutex",
-  caml_mutex_finalize,
-  caml_mutex_condition_compare,
-  custom_hash_default,
-  custom_serialize_default,
-  custom_deserialize_default
-};
-
-value caml_mutex_new(value unit)        /* ML */
-{
-  pthread_mutex_t * mut;
-  value wrapper;
-  mut = stat_alloc(sizeof(pthread_mutex_t));
-  caml_pthread_check(pthread_mutex_init(mut, NULL), "Mutex.create");
-  wrapper = alloc_custom(&caml_mutex_ops, sizeof(pthread_mutex_t *),
-                         1, Max_mutex_number);
-  Mutex_val(wrapper) = mut;
-  return wrapper;
-}
-
-value caml_mutex_lock(value wrapper)     /* ML */
-{
-  int retcode;
-  pthread_mutex_t * mut = Mutex_val(wrapper);
-  /* PR#4351: first try to acquire mutex without releasing the master lock */
-  retcode = pthread_mutex_trylock(mut);
-  if (retcode == 0) return Val_unit;
-  /* If unsuccessful, block on mutex */
-  Begin_root(wrapper)           /* prevent the deallocation of mutex */
-    enter_blocking_section();
-    retcode = pthread_mutex_lock(mut);
-    leave_blocking_section();
-  End_roots();
-  caml_pthread_check(retcode, "Mutex.lock");
-  return Val_unit;
-}
-
-value caml_mutex_unlock(value wrapper)           /* ML */
-{
-  int retcode;
-  pthread_mutex_t * mut = Mutex_val(wrapper);
-  /* PR#4351: no need to release and reacquire master lock */
-  retcode = pthread_mutex_unlock(mut);
-  caml_pthread_check(retcode, "Mutex.unlock");
-  return Val_unit;
-}
-
-value caml_mutex_try_lock(value wrapper)           /* ML */
-{
-  int retcode;
-  pthread_mutex_t * mut = Mutex_val(wrapper);
-  retcode = pthread_mutex_trylock(mut);
-  if (retcode == EBUSY) return Val_false;
-  caml_pthread_check(retcode, "Mutex.try_lock");
-  return Val_true;
-}
-
-/* Conditions operations */
-
-#define Condition_val(v) (* ((pthread_cond_t **) Data_custom_val(v)))
-#define Max_condition_number 1000
-
-static void caml_condition_finalize(value wrapper)
-{
-  pthread_cond_t * cond = Condition_val(wrapper);
-  pthread_cond_destroy(cond);
-  stat_free(cond);
-}
-
-static struct custom_operations caml_condition_ops = {
-  "_condition",
-  caml_condition_finalize,
-  caml_mutex_condition_compare,
-  custom_hash_default,
-  custom_serialize_default,
-  custom_deserialize_default
-};
-
-value caml_condition_new(value unit)        /* ML */
-{
-  pthread_cond_t * cond;
-  value wrapper;
-  cond = stat_alloc(sizeof(pthread_cond_t));
-  caml_pthread_check(pthread_cond_init(cond, NULL), "Condition.create");
-  wrapper = alloc_custom(&caml_condition_ops, sizeof(pthread_cond_t *),
-                         1, Max_condition_number);
-  Condition_val(wrapper) = cond;
-  return wrapper;
-}
-
-value caml_condition_wait(value wcond, value wmut)           /* ML */
-{
-  int retcode;
-  pthread_cond_t * cond = Condition_val(wcond);
-  pthread_mutex_t * mut = Mutex_val(wmut);
-  Begin_roots2(wcond, wmut)     /* prevent deallocation of cond and mutex */
-    enter_blocking_section();
-    retcode = pthread_cond_wait(cond, mut);
-    leave_blocking_section();
-  End_roots();
-  caml_pthread_check(retcode, "Condition.wait");
-  return Val_unit;
-}
-
-value caml_condition_signal(value wrapper)           /* ML */
-{
-  int retcode;
-  pthread_cond_t * cond = Condition_val(wrapper);
-  retcode = pthread_cond_signal(cond);
-  caml_pthread_check(retcode, "Condition.signal");
-  return Val_unit;
-}
-
-value caml_condition_broadcast(value wrapper)           /* ML */
-{
-  int retcode;
-  pthread_cond_t * cond = Condition_val(wrapper);
-  retcode = pthread_cond_broadcast(cond);
-  caml_pthread_check(retcode, "Condition.broadcast");
-  return Val_unit;
-}
-
-/* Thread status blocks */
-
-struct caml_threadstatus {
-  pthread_mutex_t lock;          /* mutex for mutual exclusion */
-  enum { ALIVE, TERMINATED } status;   /* status of thread */
-  pthread_cond_t terminated;    /* signaled when thread terminates */
-};
-
-#define Threadstatus_val(v) \
-  (* ((struct caml_threadstatus **) Data_custom_val(v)))
-#define Max_threadstatus_number 500
-
-static void caml_threadstatus_finalize(value wrapper)
-{
-  struct caml_threadstatus * ts = Threadstatus_val(wrapper);
-  pthread_mutex_destroy(&ts->lock);
-  pthread_cond_destroy(&ts->terminated);
-  stat_free(ts);
-}
-
-static struct custom_operations caml_threadstatus_ops = {
-  "_threadstatus",
-  caml_threadstatus_finalize,
-  caml_mutex_condition_compare,
-  custom_hash_default,
-  custom_serialize_default,
-  custom_deserialize_default
-};
-
-value caml_threadstatus_new (void)
-{
-  struct caml_threadstatus * ts;
-  value wrapper;
-  ts = stat_alloc(sizeof(struct caml_threadstatus));
-  caml_pthread_check(pthread_mutex_init(&ts->lock, NULL), "Thread.create");
-  caml_pthread_check(pthread_cond_init(&ts->terminated, NULL),
-                     "Thread.create");
-  ts->status = ALIVE;
-  wrapper = alloc_custom(&caml_threadstatus_ops,
-                         sizeof(struct caml_threadstatus *),
-                         1, Max_threadstatus_number);
-  Threadstatus_val(wrapper) = ts;
-  return wrapper;
-}
-
-void caml_threadstatus_terminate (value wrapper)
-{
-  struct caml_threadstatus * ts = Threadstatus_val(wrapper);
-  pthread_mutex_lock(&ts->lock);
-  ts->status = TERMINATED;
-  pthread_mutex_unlock(&ts->lock);
-  pthread_cond_broadcast(&ts->terminated);
-}
-
-int caml_threadstatus_wait (value wrapper)
-{
-  struct caml_threadstatus * ts = Threadstatus_val(wrapper);
-  int retcode;
-
-  Begin_roots1(wrapper)         /* prevent deallocation of ts */
-    enter_blocking_section();
-    retcode = pthread_mutex_lock(&ts->lock);
-    if (retcode != 0) goto error;
-    while (ts->status != TERMINATED) {
-      retcode = pthread_cond_wait(&ts->terminated, &ts->lock);
-      if (retcode != 0) goto error;
-    }
-    retcode = pthread_mutex_unlock(&ts->lock);
- error:
-    leave_blocking_section();
-  End_roots();
-  return retcode;
-}
-
-/* Signal mask */
-
-static void decode_sigset(value vset, sigset_t * set)
-{
-  sigemptyset(set);
-  while (vset != Val_int(0)) {
-    int sig = caml_convert_signal_number(Int_val(Field(vset, 0)));
-    sigaddset(set, sig);
-    vset = Field(vset, 1);
-  }
-}
-
-#ifndef NSIG
-#define NSIG 64
-#endif
-
-static value encode_sigset(sigset_t * set)
-{
-  value res = Val_int(0);
-  int i;
-
-  Begin_root(res)
-    for (i = 1; i < NSIG; i++)
-      if (sigismember(set, i) > 0) {
-        value newcons = alloc_small(2, 0);
-        Field(newcons, 0) = Val_int(caml_rev_convert_signal_number(i));
-        Field(newcons, 1) = res;
-        res = newcons;
-      }
-  End_roots();
-  return res;
-}
-
-static int sigmask_cmd[3] = { SIG_SETMASK, SIG_BLOCK, SIG_UNBLOCK };
-
-value caml_thread_sigmask(value cmd, value sigs) /* ML */
-{
-  int how;
-  sigset_t set, oldset;
-  int retcode;
-
-  how = sigmask_cmd[Int_val(cmd)];
-  decode_sigset(sigs, &set);
-  enter_blocking_section();
-  retcode = pthread_sigmask(how, &set, &oldset);
-  leave_blocking_section();
-  caml_pthread_check(retcode, "Thread.sigmask");
-  return encode_sigset(&oldset);
-}
-
-/* Synchronous signal wait */
-
-value caml_wait_signal(value sigs) /* ML */
-{
-#ifdef HAS_SIGWAIT
-  sigset_t set;
-  int retcode, signo;
-
-  decode_sigset(sigs, &set);
-  enter_blocking_section();
-  retcode = sigwait(&set, &signo);
-  leave_blocking_section();
-  caml_pthread_check(retcode, "Thread.wait_signal");
-  return Val_int(signo);
-#else
-  invalid_argument("Thread.wait_signal not implemented");
-  return Val_int(0);            /* not reached */
-#endif
-}
-
-/* Error report */
-
-static void caml_pthread_check(int retcode, char *msg)
-{
-  char * err;
-  int errlen, msglen;
-  value str;
-
-  if (retcode == 0) return;
-  err = strerror(retcode);
-  msglen = strlen(msg);
-  errlen = strlen(err);
-  str = alloc_string(msglen + 2 + errlen);
-  memmove (&Byte(str, 0), msg, msglen);
-  memmove (&Byte(str, msglen), ": ", 2);
-  memmove (&Byte(str, msglen + 2), err, errlen);
-  raise_sys_error(str);
-}
diff --git a/otherlibs/systhreads/st_posix.h b/otherlibs/systhreads/st_posix.h
new file mode 100644 (file)
index 0000000..5f9592d
--- /dev/null
@@ -0,0 +1,431 @@
+/***********************************************************************/
+/*                                                                     */
+/*                             Objective Caml                          */
+/*                                                                     */
+/*         Xavier Leroy and Damien Doligez, INRIA Rocquencourt         */
+/*                                                                     */
+/*  Copyright 2009 Institut National de Recherche en Informatique et   */
+/*  en Automatique.  All rights reserved.  This file is distributed    */
+/*  under the terms of the GNU Library General Public License, with    */
+/*  the special exception on linking described in file ../../LICENSE.  */
+/*                                                                     */
+/***********************************************************************/
+
+/* $Id: posix.c 9270 2009-05-20 11:52:42Z doligez $ */
+
+/* POSIX thread implementation of the "st" interface */
+
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+#ifdef __sun
+#define _POSIX_PTHREAD_SEMANTICS
+#endif
+#include <signal.h>
+#include <sys/time.h>
+#ifdef __linux__
+#include <unistd.h>
+#endif
+
+#ifdef __GNUC__
+#define INLINE inline
+#else
+#define INLINE
+#endif
+
+typedef int st_retcode;
+
+#define SIGPREEMPTION SIGVTALRM
+
+/* OS-specific initialization */
+
+static int st_initialize(void)
+{
+  return 0;
+}
+
+/* Thread creation.  Created in detached mode if [res] is NULL. */
+
+typedef pthread_t st_thread_id;
+
+static int st_thread_create(st_thread_id * res,
+                            void * (*fn)(void *), void * arg)
+{
+  pthread_t thr;
+  pthread_attr_t attr;
+  int rc;
+
+  pthread_attr_init(&attr);
+  if (res == NULL) pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+  rc = pthread_create(&thr, &attr, fn, arg);
+  if (res != NULL) *res = thr;
+  return rc;
+}
+
+#define ST_THREAD_FUNCTION void *
+
+/* Cleanup at thread exit */
+
+static INLINE void st_thread_cleanup(void)
+{
+  return;
+}
+
+/* Thread termination */
+
+static void st_thread_exit(void)
+{
+  pthread_exit(NULL);
+}
+
+static void st_thread_kill(st_thread_id thr)
+{
+  pthread_cancel(thr);
+}
+
+/* Scheduling hints */
+
+static void INLINE st_thread_yield(void)
+{
+#ifndef __linux__
+  /* sched_yield() doesn't do what we want in Linux 2.6 and up (PR#2663) */
+  sched_yield();
+#endif
+}
+
+/* Thread-specific state */
+
+typedef pthread_key_t st_tlskey;
+
+static int st_tls_newkey(st_tlskey * res)
+{
+  return pthread_key_create(res, NULL);
+}
+
+static INLINE void * st_tls_get(st_tlskey k)
+{
+  return pthread_getspecific(k);
+}
+
+static INLINE void st_tls_set(st_tlskey k, void * v)
+{
+  pthread_setspecific(k, v);
+}
+
+/* The master lock.  This is a mutex that is held most of the time,
+   so we implement it in a slightly consoluted way to avoid
+   all risks of busy-waiting.  Also, we count the number of waiting
+   threads. */
+
+typedef struct {
+  pthread_mutex_t lock;         /* to protect contents  */
+  int busy;                     /* 0 = free, 1 = taken */
+  volatile int waiters;         /* number of threads waiting on master lock */
+  pthread_cond_t is_free;       /* signaled when free */
+} st_masterlock;
+
+static void st_masterlock_init(st_masterlock * m)
+{
+  pthread_mutex_init(&m->lock, NULL);
+  pthread_cond_init(&m->is_free, NULL);
+  m->busy = 1;
+  m->waiters = 0;
+}
+
+static void st_masterlock_acquire(st_masterlock * m)
+{
+  pthread_mutex_lock(&m->lock);
+  while (m->busy) {
+    m->waiters ++;
+    pthread_cond_wait(&m->is_free, &m->lock);
+    m->waiters --;
+  }
+  m->busy = 1;
+  pthread_mutex_unlock(&m->lock);
+}
+
+static void st_masterlock_release(st_masterlock * m)
+{
+  pthread_mutex_lock(&m->lock);
+  m->busy = 0;
+  pthread_mutex_unlock(&m->lock);
+  pthread_cond_signal(&m->is_free);
+}
+
+static INLINE int st_masterlock_waiters(st_masterlock * m)
+{
+  return m->waiters;
+}
+/* Mutexes */
+
+typedef pthread_mutex_t * st_mutex;
+
+static int st_mutex_create(st_mutex * res)
+{
+  int rc;
+  st_mutex m = malloc(sizeof(pthread_mutex_t));
+  if (m == NULL) return ENOMEM;
+  rc = pthread_mutex_init(m, NULL);
+  if (rc != 0) { free(m); return rc; }
+  *res = m;
+  return 0;
+}
+
+static int st_mutex_destroy(st_mutex m)
+{
+  int rc;
+  rc = pthread_mutex_destroy(m);
+  free(m);
+  return rc;
+}
+
+static INLINE int st_mutex_lock(st_mutex m)
+{
+  return pthread_mutex_lock(m);
+}
+
+#define PREVIOUSLY_UNLOCKED 0
+#define ALREADY_LOCKED EBUSY
+
+static INLINE int st_mutex_trylock(st_mutex m)
+{
+  return pthread_mutex_trylock(m);
+}
+
+static INLINE int st_mutex_unlock(st_mutex m)
+{
+  return pthread_mutex_unlock(m);
+}
+
+/* Condition variables */
+
+typedef pthread_cond_t * st_condvar;
+
+static int st_condvar_create(st_condvar * res)
+{
+  int rc;
+  st_condvar c = malloc(sizeof(pthread_cond_t));
+  if (c == NULL) return ENOMEM;
+  rc = pthread_cond_init(c, NULL);
+  if (rc != 0) { free(c); return rc; }
+  *res = c;
+  return 0;
+}
+
+static int st_condvar_destroy(st_condvar c)
+{
+  int rc;
+  rc = pthread_cond_destroy(c);
+  free(c);
+  return rc;
+}
+
+static INLINE int st_condvar_signal(st_condvar c)
+{
+  return pthread_cond_signal(c);
+}
+
+static INLINE int st_condvar_broadcast(st_condvar c)
+{
+  return pthread_cond_broadcast(c);
+}
+
+static INLINE int st_condvar_wait(st_condvar c, st_mutex m)
+{
+  return pthread_cond_wait(c, m);
+}
+
+/* Triggered events */
+
+typedef struct st_event_struct {
+  pthread_mutex_t lock;         /* to protect contents */
+  int status;                   /* 0 = not triggered, 1 = triggered */
+  pthread_cond_t triggered;     /* signaled when triggered */
+} * st_event;
+
+static int st_event_create(st_event * res)
+{
+  int rc;
+  st_event e = malloc(sizeof(struct st_event_struct));
+  if (e == NULL) return ENOMEM;
+  rc = pthread_mutex_init(&e->lock, NULL);
+  if (rc != 0) { free(e); return rc; }
+  rc = pthread_cond_init(&e->triggered, NULL);
+  if (rc != 0) { free(e); return rc; }
+  e->status = 0;
+  *res = e;
+  return 0;
+}
+
+static int st_event_destroy(st_event e)
+{
+  int rc1, rc2;
+  rc1 = pthread_mutex_destroy(&e->lock);
+  rc2 = pthread_cond_destroy(&e->triggered);
+  free(e);
+  return rc1 != 0 ? rc1 : rc2;
+}
+
+static int st_event_trigger(st_event e)
+{
+  int rc;
+  rc = pthread_mutex_lock(&e->lock);
+  if (rc != 0) return rc;
+  e->status = 1;
+  rc = pthread_mutex_unlock(&e->lock);
+  if (rc != 0) return rc;
+  rc = pthread_cond_broadcast(&e->triggered);
+  return rc;
+}
+
+static int st_event_wait(st_event e)
+{
+  int rc;
+  rc = pthread_mutex_lock(&e->lock);
+  if (rc != 0) return rc;
+  while(e->status == 0) {
+    rc = pthread_cond_wait(&e->triggered, &e->lock);
+    if (rc != 0) return rc;
+  }
+  rc = pthread_mutex_unlock(&e->lock);
+  return rc;
+}
+
+/* Reporting errors */
+
+static void st_check_error(int retcode, char * msg)
+{
+  char * err;
+  int errlen, msglen;
+  value str;
+
+  if (retcode == 0) return;
+  if (retcode == ENOMEM) raise_out_of_memory();
+  err = strerror(retcode);
+  msglen = strlen(msg);
+  errlen = strlen(err);
+  str = alloc_string(msglen + 2 + errlen);
+  memmove (&Byte(str, 0), msg, msglen);
+  memmove (&Byte(str, msglen), ": ", 2);
+  memmove (&Byte(str, msglen + 2), err, errlen);
+  raise_sys_error(str);
+}
+
+/* The tick thread: posts a SIGPREEMPTION signal periodically */
+
+static void * caml_thread_tick(void * arg)
+{
+  struct timeval timeout;
+  sigset_t mask;
+#ifdef __linux__
+  int tickcount = 0;
+#endif
+
+  /* Block all signals so that we don't try to execute a Caml signal handler */
+  sigfillset(&mask);
+  pthread_sigmask(SIG_BLOCK, &mask, NULL);
+  /* Allow async cancellation */
+  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
+  while(1) {
+    /* select() seems to be the most efficient way to suspend the
+       thread for sub-second intervals */
+    timeout.tv_sec = 0;
+    timeout.tv_usec = Thread_timeout * 1000;
+    select(0, NULL, NULL, NULL, &timeout);
+    /* The preemption signal should never cause a callback, so don't
+     go through caml_handle_signal(), just record signal delivery via
+     caml_record_signal(). */
+    caml_record_signal(SIGPREEMPTION);
+#ifdef __linux__
+    /* Hack around LinuxThreads' non-standard signal handling:
+       if program is killed on a signal, e.g. SIGINT, the current
+       thread will not die on this signal (because of the signal blocking
+       above).  Hence, periodically check that the thread manager (our
+       parent process) still exists. */
+    tickcount++;
+    if (tickcount >= 2000 / Thread_timeout) { /* every 2 secs approx */
+      tickcount = 0;
+      if (getppid() == 1) pthread_exit(NULL);
+    }
+#endif
+  }
+  return NULL;                  /* prevents compiler warning */
+}
+
+/* "At fork" processing */
+
+static int st_atfork(void (*fn)(void))
+{
+  return pthread_atfork(NULL, NULL, fn);
+}
+
+/* Signal handling */
+
+static void st_decode_sigset(value vset, sigset_t * set)
+{
+  sigemptyset(set);
+  while (vset != Val_int(0)) {
+    int sig = caml_convert_signal_number(Int_val(Field(vset, 0)));
+    sigaddset(set, sig);
+    vset = Field(vset, 1);
+  }
+}
+
+#ifndef NSIG
+#define NSIG 64
+#endif
+
+static value st_encode_sigset(sigset_t * set)
+{
+  value res = Val_int(0);
+  int i;
+
+  Begin_root(res)
+    for (i = 1; i < NSIG; i++)
+      if (sigismember(set, i) > 0) {
+        value newcons = alloc_small(2, 0);
+        Field(newcons, 0) = Val_int(caml_rev_convert_signal_number(i));
+        Field(newcons, 1) = res;
+        res = newcons;
+      }
+  End_roots();
+  return res;
+}
+
+static int sigmask_cmd[3] = { SIG_SETMASK, SIG_BLOCK, SIG_UNBLOCK };
+
+value caml_thread_sigmask(value cmd, value sigs) /* ML */
+{
+  int how;
+  sigset_t set, oldset;
+  int retcode;
+
+  how = sigmask_cmd[Int_val(cmd)];
+  st_decode_sigset(sigs, &set);
+  enter_blocking_section();
+  retcode = pthread_sigmask(how, &set, &oldset);
+  leave_blocking_section();
+  st_check_error(retcode, "Thread.sigmask");
+  return st_encode_sigset(&oldset);
+}
+
+value caml_wait_signal(value sigs) /* ML */
+{
+#ifdef HAS_SIGWAIT
+  sigset_t set;
+  int retcode, signo;
+
+  st_decode_sigset(sigs, &set);
+  enter_blocking_section();
+  retcode = sigwait(&set, &signo);
+  leave_blocking_section();
+  st_check_error(retcode, "Thread.wait_signal");
+  return Val_int(signo);
+#else
+  invalid_argument("Thread.wait_signal not implemented");
+  return Val_int(0);           /* not reached */
+#endif
+}
diff --git a/otherlibs/systhreads/st_stubs.c b/otherlibs/systhreads/st_stubs.c
new file mode 100644 (file)
index 0000000..2e65ecd
--- /dev/null
@@ -0,0 +1,852 @@
+/***********************************************************************/
+/*                                                                     */
+/*                             Objective Caml                          */
+/*                                                                     */
+/*         Xavier Leroy and Damien Doligez, INRIA Rocquencourt         */
+/*                                                                     */
+/*  Copyright 1995 Institut National de Recherche en Informatique et   */
+/*  en Automatique.  All rights reserved.  This file is distributed    */
+/*  under the terms of the GNU Library General Public License, with    */
+/*  the special exception on linking described in file ../../LICENSE.  */
+/*                                                                     */
+/***********************************************************************/
+
+/* $Id: posix.c 9270 2009-05-20 11:52:42Z doligez $ */
+
+#include "alloc.h"
+#include "backtrace.h"
+#include "callback.h"
+#include "custom.h"
+#include "fail.h"
+#include "io.h"
+#include "memory.h"
+#include "misc.h"
+#include "mlvalues.h"
+#include "printexc.h"
+#include "roots.h"
+#include "signals.h"
+#ifdef NATIVE_CODE
+#include "stack.h"
+#else
+#include "stacks.h"
+#endif
+#include "sys.h"
+#include "threads.h"
+
+/* Initial size of bytecode stack when a thread is created (4 Ko) */
+#define Thread_stack_size (Stack_size / 4)
+
+/* Max computation time before rescheduling, in milliseconds */
+#define Thread_timeout 50
+
+/* OS-specific code */
+#ifdef _WIN32
+#include "st_win32.h"
+#else
+#include "st_posix.h"
+#endif
+
+/* The ML value describing a thread (heap-allocated) */
+
+struct caml_thread_descr {
+  value ident;                  /* Unique integer ID */
+  value start_closure;          /* The closure to start this thread */
+  value terminated;             /* Triggered event for thread termination */
+};
+
+#define Ident(v) (((struct caml_thread_descr *)(v))->ident)
+#define Start_closure(v) (((struct caml_thread_descr *)(v))->start_closure)
+#define Terminated(v) (((struct caml_thread_descr *)(v))->terminated)
+
+/* The infos on threads (allocated via malloc()) */
+
+struct caml_thread_struct {
+  value descr;                  /* The heap-allocated descriptor (root) */
+  struct caml_thread_struct * next;  /* Double linking of running threads */
+  struct caml_thread_struct * prev;
+#ifdef NATIVE_CODE
+  char * top_of_stack;          /* Top of stack for this thread (approx.) */
+  char * bottom_of_stack;       /* Saved value of caml_bottom_of_stack */
+  uintnat last_retaddr;         /* Saved value of caml_last_return_address */
+  value * gc_regs;              /* Saved value of caml_gc_regs */
+  char * exception_pointer;     /* Saved value of caml_exception_pointer */
+  struct caml__roots_block * local_roots; /* Saved value of local_roots */
+  struct longjmp_buffer * exit_buf; /* For thread exit */
+#else
+  value * stack_low;            /* The execution stack for this thread */
+  value * stack_high;
+  value * stack_threshold;
+  value * sp;                   /* Saved value of extern_sp for this thread */
+  value * trapsp;               /* Saved value of trapsp for this thread */
+  struct caml__roots_block * local_roots; /* Saved value of local_roots */
+  struct longjmp_buffer * external_raise; /* Saved external_raise */
+#endif
+  int backtrace_pos;            /* Saved backtrace_pos */
+  code_t * backtrace_buffer;    /* Saved backtrace_buffer */
+  value backtrace_last_exn;     /* Saved backtrace_last_exn (root) */
+};
+
+typedef struct caml_thread_struct * caml_thread_t;
+
+/* The "head" of the circular list of thread descriptors */
+static caml_thread_t all_threads = NULL;
+
+/* The descriptor for the currently executing thread */
+static caml_thread_t curr_thread = NULL;
+
+/* The master lock protecting the Caml runtime system */
+static st_masterlock caml_master_lock;
+
+/* Whether the ``tick'' thread is already running */
+static int caml_tick_thread_running = 0;
+
+/* The thread identifier of the ``tick'' thread */
+static st_thread_id caml_tick_thread_id;
+
+/* The key used for storing the thread descriptor in the specific data
+   of the corresponding system thread. */
+static st_tlskey thread_descriptor_key;
+
+/* The key used for unlocking I/O channels on exceptions */
+static st_tlskey last_channel_locked_key;
+
+/* Identifier for next thread creation */
+static intnat thread_next_ident = 0;
+
+/* Forward declarations */
+static value caml_threadstatus_new (void);
+static void caml_threadstatus_terminate (value);
+static st_retcode caml_threadstatus_wait (value);
+
+/* Imports from the native-code runtime system */
+#ifdef NATIVE_CODE
+extern struct longjmp_buffer caml_termination_jmpbuf;
+extern void (*caml_termination_hook)(void);
+#endif
+
+/* Hook for scanning the stacks of the other threads */
+
+static void (*prev_scan_roots_hook) (scanning_action);
+
+static void caml_thread_scan_roots(scanning_action action)
+{
+  caml_thread_t th;
+
+  th = curr_thread;
+  do {
+    (*action)(th->descr, &th->descr);
+    (*action)(th->backtrace_last_exn, &th->backtrace_last_exn);
+    /* Don't rescan the stack of the current thread, it was done already */
+    if (th != curr_thread) {
+#ifdef NATIVE_CODE
+      if (th->bottom_of_stack != NULL)
+        do_local_roots(action, th->bottom_of_stack, th->last_retaddr,
+                       th->gc_regs, th->local_roots);
+#else
+      do_local_roots(action, th->sp, th->stack_high, th->local_roots);
+#endif
+    }
+    th = th->next;
+  } while (th != curr_thread);
+  /* Hook */
+  if (prev_scan_roots_hook != NULL) (*prev_scan_roots_hook)(action);
+}
+
+/* Hooks for enter_blocking_section and leave_blocking_section */
+
+static void caml_thread_enter_blocking_section(void)
+{
+  /* Save the stack-related global variables in the thread descriptor
+     of the current thread */
+#ifdef NATIVE_CODE
+  curr_thread->bottom_of_stack = caml_bottom_of_stack;
+  curr_thread->last_retaddr = caml_last_return_address;
+  curr_thread->gc_regs = caml_gc_regs;
+  curr_thread->exception_pointer = caml_exception_pointer;
+  curr_thread->local_roots = local_roots;
+#else
+  curr_thread->stack_low = stack_low;
+  curr_thread->stack_high = stack_high;
+  curr_thread->stack_threshold = stack_threshold;
+  curr_thread->sp = extern_sp;
+  curr_thread->trapsp = trapsp;
+  curr_thread->local_roots = local_roots;
+  curr_thread->external_raise = external_raise;
+#endif
+  curr_thread->backtrace_pos = backtrace_pos;
+  curr_thread->backtrace_buffer = backtrace_buffer;
+  curr_thread->backtrace_last_exn = backtrace_last_exn;
+  /* Tell other threads that the runtime is free */
+  st_masterlock_release(&caml_master_lock);
+}
+
+static void caml_thread_leave_blocking_section(void)
+{
+  /* Wait until the runtime is free */
+  st_masterlock_acquire(&caml_master_lock);
+  /* Update curr_thread to point to the thread descriptor corresponding
+     to the thread currently executing */
+  curr_thread = st_tls_get(thread_descriptor_key);
+  /* Restore the stack-related global variables */
+#ifdef NATIVE_CODE
+  caml_bottom_of_stack= curr_thread->bottom_of_stack;
+  caml_last_return_address = curr_thread->last_retaddr;
+  caml_gc_regs = curr_thread->gc_regs;
+  caml_exception_pointer = curr_thread->exception_pointer;
+  local_roots = curr_thread->local_roots;
+#else
+  stack_low = curr_thread->stack_low;
+  stack_high = curr_thread->stack_high;
+  stack_threshold = curr_thread->stack_threshold;
+  extern_sp = curr_thread->sp;
+  trapsp = curr_thread->trapsp;
+  local_roots = curr_thread->local_roots;
+  external_raise = curr_thread->external_raise;
+#endif
+  backtrace_pos = curr_thread->backtrace_pos;
+  backtrace_buffer = curr_thread->backtrace_buffer;
+  backtrace_last_exn = curr_thread->backtrace_last_exn;
+}
+
+static int caml_thread_try_leave_blocking_section(void)
+{
+  /* Disable immediate processing of signals (PR#3659).
+     try_leave_blocking_section always fails, forcing the signal to be
+     recorded and processed at the next leave_blocking_section or
+     polling. */
+  return 0;
+}
+
+/* Hooks for I/O locking */
+
+static void caml_io_mutex_free(struct channel *chan)
+{
+  st_mutex mutex = chan->mutex;
+  if (mutex != NULL) st_mutex_destroy(mutex);
+}
+
+static void caml_io_mutex_lock(struct channel *chan)
+{
+  st_mutex mutex = chan->mutex;
+
+  if (mutex == NULL) {
+    st_mutex_create(&mutex);
+    chan->mutex = mutex;
+  }
+  /* PR#4351: first try to acquire mutex without releasing the master lock */
+  if (st_mutex_trylock(mutex) == PREVIOUSLY_UNLOCKED) {
+    st_tls_set(last_channel_locked_key, (void *) chan);
+    return;
+  }
+  /* If unsuccessful, block on mutex */
+  enter_blocking_section();
+  st_mutex_lock(mutex);
+  /* Problem: if a signal occurs at this point,
+     and the signal handler raises an exception, we will not
+     unlock the mutex.  The alternative (doing the setspecific
+     before locking the mutex is also incorrect, since we could
+     then unlock a mutex that is unlocked or locked by someone else. */
+  st_tls_set(last_channel_locked_key, (void *) chan);
+  leave_blocking_section();
+}
+
+static void caml_io_mutex_unlock(struct channel *chan)
+{
+  st_mutex_unlock(chan->mutex);
+  st_tls_set(last_channel_locked_key, NULL);
+}
+
+static void caml_io_mutex_unlock_exn(void)
+{
+  struct channel * chan = st_tls_get(last_channel_locked_key);
+  if (chan != NULL) caml_io_mutex_unlock(chan);
+}
+
+/* Hook for estimating stack usage */
+
+static uintnat (*prev_stack_usage_hook)(void);
+
+static uintnat caml_thread_stack_usage(void)
+{
+  uintnat sz;
+  caml_thread_t th;
+
+  /* Don't add stack for current thread, this is done elsewhere */
+  for (sz = 0, th = curr_thread->next;
+       th != curr_thread;
+       th = th->next) {
+#ifdef NATIVE_CODE
+    sz += (value *) th->top_of_stack - (value *) th->bottom_of_stack;
+#else
+    sz += th->stack_high - th->sp;
+#endif    
+  }
+  if (prev_stack_usage_hook != NULL)
+    sz += prev_stack_usage_hook();
+  return sz;
+}
+
+/* Create and setup a new thread info block.
+   This block has no associated thread descriptor and
+   is not inserted in the list of threads. */
+
+static caml_thread_t caml_thread_new_info(void)
+{
+  caml_thread_t th;
+
+  th = (caml_thread_t) malloc(sizeof(struct caml_thread_struct));
+  if (th == NULL) return NULL;
+  th->descr = Val_unit;         /* filled later */
+#ifdef NATIVE_CODE
+  th->bottom_of_stack = NULL;
+  th->top_of_stack = NULL;
+  th->last_retaddr = 1;
+  th->exception_pointer = NULL;
+  th->local_roots = NULL;
+  th->exit_buf = NULL;
+#else
+  /* Allocate the stacks */
+  th->stack_low = (value *) stat_alloc(Thread_stack_size);
+  th->stack_high = th->stack_low + Thread_stack_size / sizeof(value);
+  th->stack_threshold = th->stack_low + Stack_threshold / sizeof(value);
+  th->sp = th->stack_high;
+  th->trapsp = th->stack_high;
+  th->local_roots = NULL;
+  th->external_raise = NULL;
+#endif
+  th->backtrace_pos = 0;
+  th->backtrace_buffer = NULL;
+  th->backtrace_last_exn = Val_unit;
+  return th;
+}
+
+/* Allocate a thread descriptor block. */
+
+static value caml_thread_new_descriptor(value clos)
+{
+  value mu = Val_unit;
+  value descr;
+  Begin_roots2 (clos, mu)
+    /* Create and initialize the termination semaphore */
+    mu = caml_threadstatus_new();
+    /* Create a descriptor for the new thread */
+    descr = alloc_small(3, 0);
+    Ident(descr) = Val_long(thread_next_ident);
+    Start_closure(descr) = clos;
+    Terminated(descr) = mu;
+    thread_next_ident++;
+  End_roots();
+  return descr;
+}
+
+/* Remove a thread info block from the list of threads.
+   Free it and its stack resources. */
+
+static void caml_thread_remove_info(caml_thread_t th)
+{
+  if (th->next == th) all_threads = NULL; /* last Caml thread exiting */
+  th->next->prev = th->prev;
+  th->prev->next = th->next;
+#ifndef NATIVE_CODE
+  stat_free(th->stack_low);
+#endif
+  if (th->backtrace_buffer != NULL) free(th->backtrace_buffer);
+  stat_free(th);
+}
+
+/* Reinitialize the thread machinery after a fork() (PR#4577) */
+
+static void caml_thread_reinitialize(void)
+{
+  caml_thread_t thr, next;
+  struct channel * chan;
+
+  /* Remove all other threads (now nonexistent)
+     from the doubly-linked list of threads */
+  thr = curr_thread->next;
+  while (thr != curr_thread) {
+    next = thr->next;
+    stat_free(thr);
+    thr = next;
+  }
+  curr_thread->next = curr_thread;
+  curr_thread->prev = curr_thread;
+  all_threads = curr_thread;
+  /* Reinitialize the master lock machinery,
+     just in case the fork happened while other threads were doing
+     leave_blocking_section */
+  st_masterlock_init(&caml_master_lock);
+  /* Tick thread is not currently running in child process, will be
+     re-created at next Thread.create */
+  caml_tick_thread_running = 0;
+  /* Destroy all IO mutexes; will be reinitialized on demand */
+  for (chan = caml_all_opened_channels;
+       chan != NULL;
+       chan = chan->next) {
+    if (chan->mutex != NULL) {
+      st_mutex_destroy(chan->mutex);
+      chan->mutex = NULL;
+    }
+  }
+}
+
+/* Initialize the thread machinery */
+
+CAMLprim value caml_thread_initialize(value unit)   /* ML */
+{
+  /* Protect against repeated initialization (PR#1325) */
+  if (curr_thread != NULL) return Val_unit;
+  /* OS-specific initialization */
+  st_initialize();
+  /* Initialize and acquire the master lock */
+  st_masterlock_init(&caml_master_lock);
+  /* Initialize the keys */
+  st_tls_newkey(&thread_descriptor_key);
+  st_tls_newkey(&last_channel_locked_key);
+  /* Set up a thread info block for the current thread */
+  curr_thread =
+    (caml_thread_t) stat_alloc(sizeof(struct caml_thread_struct));
+  curr_thread->descr = caml_thread_new_descriptor(Val_unit);
+  curr_thread->next = curr_thread;
+  curr_thread->prev = curr_thread;
+  all_threads = curr_thread;
+  curr_thread->backtrace_last_exn = Val_unit;
+#ifdef NATIVE_CODE
+  curr_thread->exit_buf = &caml_termination_jmpbuf;
+#endif
+  /* The stack-related fields will be filled in at the next
+     enter_blocking_section */
+  /* Associate the thread descriptor with the thread */
+  st_tls_set(thread_descriptor_key, (void *) curr_thread);
+  /* Set up the hooks */
+  prev_scan_roots_hook = scan_roots_hook;
+  scan_roots_hook = caml_thread_scan_roots;
+  enter_blocking_section_hook = caml_thread_enter_blocking_section;
+  leave_blocking_section_hook = caml_thread_leave_blocking_section;
+  try_leave_blocking_section_hook = caml_thread_try_leave_blocking_section;
+#ifdef NATIVE_CODE
+  caml_termination_hook = st_thread_exit;
+#endif
+  caml_channel_mutex_free = caml_io_mutex_free;
+  caml_channel_mutex_lock = caml_io_mutex_lock;
+  caml_channel_mutex_unlock = caml_io_mutex_unlock;
+  caml_channel_mutex_unlock_exn = caml_io_mutex_unlock_exn;
+  prev_stack_usage_hook = caml_stack_usage_hook;
+  caml_stack_usage_hook = caml_thread_stack_usage;
+  /* Set up fork() to reinitialize the thread machinery in the child
+     (PR#4577) */
+  st_atfork(caml_thread_reinitialize);
+  return Val_unit;
+}
+
+/* Cleanup the thread machinery on program exit or DLL unload. */
+
+CAMLprim value caml_thread_cleanup(value unit)   /* ML */
+{
+  if (caml_tick_thread_running) st_thread_kill(caml_tick_thread_id);
+  return Val_unit;
+}
+
+/* Thread cleanup at termination */
+
+static void caml_thread_stop(void)
+{
+  /* Signal that the thread has terminated */
+  caml_threadstatus_terminate(Terminated(curr_thread->descr));
+  /* Remove th from the doubly-linked list of threads and free its info block */
+  caml_thread_remove_info(curr_thread);
+  /* OS-specific cleanups */
+  st_thread_cleanup();
+  /* Release the runtime system */
+  st_masterlock_release(&caml_master_lock);
+}
+
+/* Create a thread */
+
+static ST_THREAD_FUNCTION caml_thread_start(void * arg)
+{
+  caml_thread_t th = (caml_thread_t) arg;
+  value clos;
+#ifdef NATIVE_CODE
+  struct longjmp_buffer termination_buf;
+  char tos;
+#endif
+
+  /* Associate the thread descriptor with the thread */
+  st_tls_set(thread_descriptor_key, (void *) th);
+  /* Acquire the global mutex */
+  leave_blocking_section();
+#ifdef NATIVE_CODE
+  /* Record top of stack (approximative) */
+  th->top_of_stack = &tos;
+  /* Setup termination handler (for caml_thread_exit) */
+  if (sigsetjmp(termination_buf.buf, 0) == 0) {
+    th->exit_buf = &termination_buf;
+#endif
+    /* Callback the closure */
+    clos = Start_closure(th->descr);
+    modify(&(Start_closure(th->descr)), Val_unit);
+    callback_exn(clos, Val_unit);
+    caml_thread_stop();
+#ifdef NATIVE_CODE
+  }
+#endif
+  /* The thread now stops running */
+  return 0;
+}  
+
+CAMLprim value caml_thread_new(value clos)          /* ML */
+{
+  caml_thread_t th;
+  st_retcode err;
+
+  /* Create a thread info block */
+  th = caml_thread_new_info();
+  if (th == NULL) caml_raise_out_of_memory();
+  /* Equip it with a thread descriptor */
+  th->descr = caml_thread_new_descriptor(clos);
+  /* Add thread info block to the list of threads */
+  th->next = curr_thread->next;
+  th->prev = curr_thread;
+  curr_thread->next->prev = th;
+  curr_thread->next = th;
+  /* Create the new thread */
+  err = st_thread_create(NULL, caml_thread_start, (void *) th);
+  if (err != 0) {
+    /* Creation failed, remove thread info block from list of threads */
+    caml_thread_remove_info(th);
+    st_check_error(err, "Thread.create");
+  }
+  /* Create the tick thread if not already done.  
+     Because of PR#4666, we start the tick thread late, only when we create
+     the first additional thread in the current process*/
+  if (! caml_tick_thread_running) {
+    err = st_thread_create(&caml_tick_thread_id, caml_thread_tick, NULL);
+    st_check_error(err, "Thread.create");
+    caml_tick_thread_running = 1;
+  }
+  return th->descr;
+}
+
+/* Register a thread already created from C */
+
+CAMLexport int caml_c_thread_register(void)
+{
+  caml_thread_t th;
+  st_retcode err;
+
+  /* Already registered? */
+  if (st_tls_get(thread_descriptor_key) != NULL) return 0;
+  /* Create a thread info block */
+  th = caml_thread_new_info();
+  if (th == NULL) return 0;
+#ifdef NATIVE_CODE
+  th->top_of_stack = (char *) &err;
+#endif
+  /* Take master lock to protect access to the chaining of threads */
+  st_masterlock_acquire(&caml_master_lock);
+  /* Add thread info block to the list of threads */
+  if (all_threads == NULL) {
+    th->next = th;
+    th->prev = th;
+    all_threads = th;
+  } else {
+    th->next = all_threads->next;
+    th->prev = all_threads;
+    all_threads->next->prev = th;
+    all_threads->next = th;
+  }
+  /* Associate the thread descriptor with the thread */
+  st_tls_set(thread_descriptor_key, (void *) th);
+  /* Release the master lock */
+  st_masterlock_release(&caml_master_lock);
+  /* Now we can re-enter the run-time system and heap-allocate the descriptor */
+  leave_blocking_section();
+  th->descr = caml_thread_new_descriptor(Val_unit);  /* no closure */
+  /* Create the tick thread if not already done.  */
+  if (! caml_tick_thread_running) {
+    err = st_thread_create(&caml_tick_thread_id, caml_thread_tick, NULL);
+    if (err == 0) caml_tick_thread_running = 1;
+  }
+  /* Exit the run-time system */
+  enter_blocking_section();
+  return 1;
+}
+
+/* Unregister a thread that was created from C and registered with 
+   the function above */
+
+CAMLexport int caml_c_thread_unregister(void)
+{
+  caml_thread_t th = st_tls_get(thread_descriptor_key);
+  /* Not registered? */
+  if (th == NULL) return 0;
+  /* Wait until the runtime is available */
+  st_masterlock_acquire(&caml_master_lock);
+  /* Forget the thread descriptor */
+  st_tls_set(thread_descriptor_key, NULL);
+  /* Remove thread info block from list of threads, and free it */
+  caml_thread_remove_info(th);
+  /* Release the runtime */
+  st_masterlock_release(&caml_master_lock);
+  return 1;
+}
+
+/* Return the current thread */
+
+CAMLprim value caml_thread_self(value unit)         /* ML */
+{
+  if (curr_thread == NULL) invalid_argument("Thread.self: not initialized");
+  return curr_thread->descr;
+}
+
+/* Return the identifier of a thread */
+
+CAMLprim value caml_thread_id(value th)          /* ML */
+{
+  return Ident(th);
+}
+
+/* Print uncaught exception and backtrace */
+
+CAMLprim value caml_thread_uncaught_exception(value exn)  /* ML */
+{
+  char * msg = format_caml_exception(exn);
+  fprintf(stderr, "Thread %d killed on uncaught exception %s\n",
+          Int_val(Ident(curr_thread->descr)), msg);
+  free(msg);
+  if (caml_backtrace_active) print_exception_backtrace();
+  fflush(stderr);
+  return Val_unit;
+}
+
+/* Terminate current thread */
+
+CAMLprim value caml_thread_exit(value unit)   /* ML */
+{
+  struct longjmp_buffer * exit_buf = NULL;
+
+  if (curr_thread == NULL) invalid_argument("Thread.exit: not initialized");
+
+  /* In native code, we cannot call pthread_exit here because on some
+     systems this raises a C++ exception, and ocamlopt-generated stack
+     frames cannot be unwound.  Instead, we longjmp to the thread
+     creation point (in caml_thread_start) or to the point in
+     caml_main where caml_termination_hook will be called.
+     Note that threads created in C then registered do not have
+     a creation point (exit_buf == NULL).
+ */
+#ifdef NATIVE_CODE
+  exit_buf = curr_thread->exit_buf;
+#endif
+  caml_thread_stop();
+  if (exit_buf != NULL) {
+    /* Native-code and (main thread or thread created by Caml) */
+    siglongjmp(exit_buf->buf, 1);
+  } else {
+    /* Bytecode, or thread created from C */
+    st_thread_exit();
+  }
+  return Val_unit;  /* not reached */
+}
+
+/* Allow re-scheduling */
+
+CAMLprim value caml_thread_yield(value unit)        /* ML */
+{
+  if (st_masterlock_waiters(&caml_master_lock) == 0) return Val_unit;
+  enter_blocking_section();
+  st_thread_yield();
+  leave_blocking_section();
+  return Val_unit;
+}
+
+/* Suspend the current thread until another thread terminates */
+
+CAMLprim value caml_thread_join(value th)          /* ML */
+{
+  st_retcode rc = caml_threadstatus_wait(Terminated(th));
+  st_check_error(rc, "Thread.join");
+  return Val_unit;
+}
+
+/* Mutex operations */
+
+#define Mutex_val(v) (* ((st_mutex *) Data_custom_val(v)))
+#define Max_mutex_number 5000
+
+static void caml_mutex_finalize(value wrapper)
+{
+  st_mutex_destroy(Mutex_val(wrapper));
+}
+
+static int caml_mutex_condition_compare(value wrapper1, value wrapper2)
+{
+  st_mutex mut1 = Mutex_val(wrapper1);
+  st_mutex mut2 = Mutex_val(wrapper2);
+  return mut1 == mut2 ? 0 : mut1 < mut2 ? -1 : 1;
+}
+
+static struct custom_operations caml_mutex_ops = {
+  "_mutex",
+  caml_mutex_finalize,
+  caml_mutex_condition_compare,
+  custom_hash_default,
+  custom_serialize_default,
+  custom_deserialize_default
+};
+
+CAMLprim value caml_mutex_new(value unit)        /* ML */
+{
+  st_mutex mut = NULL;          /* suppress warning */
+  value wrapper;
+  st_check_error(st_mutex_create(&mut), "Mutex.create");
+  wrapper = alloc_custom(&caml_mutex_ops, sizeof(st_mutex *),
+                         1, Max_mutex_number);
+  Mutex_val(wrapper) = mut;
+  return wrapper;
+}
+
+CAMLprim value caml_mutex_lock(value wrapper)     /* ML */
+{
+  st_mutex mut = Mutex_val(wrapper);
+  st_retcode retcode;
+
+  /* PR#4351: first try to acquire mutex without releasing the master lock */
+  if (st_mutex_trylock(mut) == PREVIOUSLY_UNLOCKED) return Val_unit;
+  /* If unsuccessful, block on mutex */
+  Begin_root(wrapper)           /* prevent the deallocation of mutex */
+    enter_blocking_section();
+    retcode = st_mutex_lock(mut);
+    leave_blocking_section();
+  End_roots();
+  st_check_error(retcode, "Mutex.lock");
+  return Val_unit;
+}
+
+CAMLprim value caml_mutex_unlock(value wrapper)           /* ML */
+{
+  st_mutex mut = Mutex_val(wrapper);
+  st_retcode retcode;
+  /* PR#4351: no need to release and reacquire master lock */
+  retcode = st_mutex_unlock(mut);
+  st_check_error(retcode, "Mutex.unlock");
+  return Val_unit;
+}
+
+CAMLprim value caml_mutex_try_lock(value wrapper)           /* ML */
+{
+  st_mutex mut = Mutex_val(wrapper);
+  st_retcode retcode;
+  retcode = st_mutex_trylock(mut);
+  if (retcode == ALREADY_LOCKED) return Val_false;
+  st_check_error(retcode, "Mutex.try_lock");
+  return Val_true;
+}
+
+/* Conditions operations */
+
+#define Condition_val(v) (* (st_condvar *) Data_custom_val(v))
+#define Max_condition_number 5000
+
+static void caml_condition_finalize(value wrapper)
+{
+  st_condvar_destroy(Condition_val(wrapper));
+}
+
+static struct custom_operations caml_condition_ops = {
+  "_condition",
+  caml_condition_finalize,
+  caml_mutex_condition_compare,
+  custom_hash_default,
+  custom_serialize_default,
+  custom_deserialize_default
+};
+
+CAMLprim value caml_condition_new(value unit)        /* ML */
+{
+  st_condvar cond = NULL;       /* suppress warning */
+  value wrapper;
+  st_check_error(st_condvar_create(&cond), "Condition.create");
+  wrapper = alloc_custom(&caml_condition_ops, sizeof(st_condvar *),
+                         1, Max_condition_number);
+  Condition_val(wrapper) = cond;
+  return wrapper;
+}
+
+CAMLprim value caml_condition_wait(value wcond, value wmut)           /* ML */
+{
+  st_condvar cond = Condition_val(wcond);
+  st_mutex mut = Mutex_val(wmut);
+  st_retcode retcode;
+
+  Begin_roots2(wcond, wmut)     /* prevent deallocation of cond and mutex */
+    enter_blocking_section();
+    retcode = st_condvar_wait(cond, mut);
+    leave_blocking_section();
+  End_roots();
+  st_check_error(retcode, "Condition.wait");
+  return Val_unit;
+}
+
+CAMLprim value caml_condition_signal(value wrapper)           /* ML */
+{
+  st_check_error(st_condvar_signal(Condition_val(wrapper)),
+                 "Condition.signal");
+  return Val_unit;
+}
+
+CAMLprim value caml_condition_broadcast(value wrapper)           /* ML */
+{
+  st_check_error(st_condvar_broadcast(Condition_val(wrapper)),
+                 "Condition.signal");
+  return Val_unit;
+}
+
+/* Thread status blocks */
+
+#define Threadstatus_val(v) (* ((st_event *) Data_custom_val(v)))
+#define Max_threadstatus_number 500
+
+static void caml_threadstatus_finalize(value wrapper)
+{
+  st_event_destroy(Threadstatus_val(wrapper));
+}
+
+static struct custom_operations caml_threadstatus_ops = {
+  "_threadstatus",
+  caml_threadstatus_finalize,
+  custom_compare_default,
+  custom_hash_default,
+  custom_serialize_default,
+  custom_deserialize_default
+};
+
+static value caml_threadstatus_new (void)
+{
+  st_event ts = NULL;           /* suppress warning */
+  value wrapper;
+  st_check_error(st_event_create(&ts), "Thread.create");
+  wrapper = alloc_custom(&caml_threadstatus_ops, sizeof(st_event *),
+                         1, Max_threadstatus_number);
+  Threadstatus_val(wrapper) = ts;
+  return wrapper;
+}
+
+static void caml_threadstatus_terminate (value wrapper)
+{
+  st_event_trigger(Threadstatus_val(wrapper));
+}
+
+static st_retcode caml_threadstatus_wait (value wrapper)
+{
+  st_event ts = Threadstatus_val(wrapper);
+  st_retcode retcode;
+
+  Begin_roots1(wrapper)         /* prevent deallocation of ts */
+    enter_blocking_section();
+    retcode = st_event_wait(ts);
+    leave_blocking_section();
+  End_roots();
+  return retcode;
+}
diff --git a/otherlibs/systhreads/st_win32.h b/otherlibs/systhreads/st_win32.h
new file mode 100644 (file)
index 0000000..e3e37c8
--- /dev/null
@@ -0,0 +1,419 @@
+/***********************************************************************/
+/*                                                                     */
+/*                             Objective Caml                          */
+/*                                                                     */
+/*         Xavier Leroy and Damien Doligez, INRIA Rocquencourt         */
+/*                                                                     */
+/*  Copyright 2009 Institut National de Recherche en Informatique et   */
+/*  en Automatique.  All rights reserved.  This file is distributed    */
+/*  under the terms of the GNU Library General Public License, with    */
+/*  the special exception on linking described in file ../../LICENSE.  */
+/*                                                                     */
+/***********************************************************************/
+
+/* $Id: posix.c 9270 2009-05-20 11:52:42Z doligez $ */
+
+/* Win32 implementation of the "st" interface */
+
+#include <windows.h>
+#include <WinError.h>
+#include <stdio.h>
+#include <signal.h>
+
+#define INLINE __inline
+
+#if 1
+#define TRACE(x)
+#define TRACE1(x,y)
+#else
+#include <stdio.h>
+#define TRACE(x) printf("%d: %s\n", GetCurrentThreadId(), x); fflush(stdout)
+#define TRACE1(x,y) printf("%d: %s %p\n", GetCurrentThreadId(), x, (void *)y); fflush(stdout)
+#endif
+
+typedef DWORD st_retcode;
+
+#define SIGPREEMPTION SIGTERM
+
+/* Thread-local storage assocaiting a Win32 event to every thread. */
+static DWORD st_thread_sem_key;
+
+/* OS-specific initialization */
+
+static DWORD st_initialize(void)
+{
+  st_thread_sem_key = TlsAlloc();
+  if (st_thread_sem_key == TLS_OUT_OF_INDEXES)
+    return GetLastError();
+  else
+    return 0;
+}
+
+/* Thread creation.  Created in detached mode if [res] is NULL. */
+
+typedef HANDLE st_thread_id;
+
+static DWORD st_thread_create(st_thread_id * res, 
+                              LPTHREAD_START_ROUTINE fn, void * arg)
+{
+  HANDLE h = CreateThread(NULL, 0, fn, arg, 0, NULL);
+  TRACE1("st_thread_create", h);
+  if (h == NULL) return GetLastError();
+  if (res == NULL)
+    CloseHandle(h);
+  else
+    *res = h;
+  return 0;
+}
+
+#define ST_THREAD_FUNCTION DWORD WINAPI
+
+/* Cleanup at thread exit */
+
+static void st_thread_cleanup(void)
+{
+  HANDLE ev = (HANDLE) TlsGetValue(st_thread_sem_key);
+  if (ev != NULL) CloseHandle(ev);
+}
+
+/* Thread termination */
+
+static void st_thread_exit(void)
+{
+  TRACE("st_thread_exit");
+  ExitThread(0);
+}
+
+static void st_thread_kill(st_thread_id thr)
+{
+  TRACE1("st_thread_kill", thr);
+  TerminateThread(thr, 0);
+  CloseHandle(thr);
+}
+
+/* Scheduling hints */
+
+static INLINE void st_thread_yield(void)
+{
+  Sleep(0);
+}
+
+/* Thread-specific state */
+
+typedef DWORD st_tlskey;
+
+static DWORD st_tls_newkey(st_tlskey * res)
+{
+  *res = TlsAlloc();
+  if (*res == TLS_OUT_OF_INDEXES)
+    return GetLastError();
+  else
+    return 0;
+}
+
+static INLINE void * st_tls_get(st_tlskey k)
+{
+  return TlsGetValue(k);
+}
+
+static INLINE void st_tls_set(st_tlskey k, void * v)
+{
+  TlsSetValue(k, v);
+}
+
+/* The master lock.  */
+
+typedef CRITICAL_SECTION st_masterlock;
+
+static void st_masterlock_init(st_masterlock * m)
+{
+  TRACE("st_masterlock_init");
+  InitializeCriticalSection(m);
+  EnterCriticalSection(m);
+}
+
+static INLINE void st_masterlock_acquire(st_masterlock * m)
+{
+  TRACE("st_masterlock_acquire");
+  EnterCriticalSection(m);
+  TRACE("st_masterlock_acquire (done)");
+}
+
+static INLINE void st_masterlock_release(st_masterlock * m)
+{
+  LeaveCriticalSection(m);
+  TRACE("st_masterlock_released");
+}
+
+static INLINE int st_masterlock_waiters(st_masterlock * m)
+{
+  return 1;                     /* info not maintained */
+}
+/* Mutexes */
+
+typedef CRITICAL_SECTION * st_mutex;
+
+static DWORD st_mutex_create(st_mutex * res)
+{
+  st_mutex m = malloc(sizeof(CRITICAL_SECTION));
+  if (m == NULL) return ERROR_NOT_ENOUGH_MEMORY;
+  InitializeCriticalSection(m);
+  *res = m;
+  return 0;
+}
+
+static DWORD st_mutex_destroy(st_mutex m)
+{
+  DeleteCriticalSection(m);
+  free(m);
+  return 0;
+}
+
+static INLINE DWORD st_mutex_lock(st_mutex m)
+{
+  TRACE1("st_mutex_lock", m);
+  EnterCriticalSection(m);
+  TRACE1("st_mutex_lock (done)", m);
+  return 0;
+}
+
+/* Error codes with the 29th bit set are reserved for the application */
+
+#define PREVIOUSLY_UNLOCKED 0
+#define ALREADY_LOCKED (1<<29)
+
+static INLINE DWORD st_mutex_trylock(st_mutex m)
+{
+  TRACE1("st_mutex_trylock", m);
+  if (TryEnterCriticalSection(m)) {
+    TRACE1("st_mutex_trylock (success)", m);
+    return PREVIOUSLY_UNLOCKED;
+  } else {
+    TRACE1("st_mutex_trylock (failure)", m);
+    return ALREADY_LOCKED;
+  }
+}
+
+static INLINE DWORD st_mutex_unlock(st_mutex m)
+{
+  TRACE1("st_mutex_unlock", m);
+  LeaveCriticalSection(m);
+  return 0;
+}
+
+/* Condition variables */
+
+/* A condition variable is just a list of threads currently
+   waiting on this c.v.  Each thread is represented by its
+   associated event. */
+
+struct st_wait_list {
+  HANDLE event;                  /* event of the first waiting thread */
+  struct st_wait_list * next;
+};
+
+typedef struct st_condvar_struct {
+  CRITICAL_SECTION lock;         /* protect the data structure */
+  struct st_wait_list * waiters; /* list of threads waiting */
+} * st_condvar;
+
+static DWORD st_condvar_create(st_condvar * res)
+{
+  st_condvar c = malloc(sizeof(struct st_condvar_struct));
+  if (c == NULL) return ERROR_NOT_ENOUGH_MEMORY;
+  InitializeCriticalSection(&c->lock);
+  c->waiters = NULL;
+  *res = c;
+  return 0;
+}
+
+static DWORD st_condvar_destroy(st_condvar c)
+{
+  TRACE1("st_condvar_destroy", c);
+  DeleteCriticalSection(&c->lock);
+  free(c);
+  return 0;
+}
+
+static DWORD st_condvar_signal(st_condvar c)
+{
+  DWORD rc = 0;
+  struct st_wait_list * curr, * next;
+
+  TRACE1("st_condvar_signal", c);
+  EnterCriticalSection(&c->lock);
+  curr = c->waiters;
+  if (curr != NULL) {
+    next = curr->next;
+    /* Wake up the first waiting thread */
+    TRACE1("st_condvar_signal: waking up", curr->event);
+    if (! SetEvent(curr->event)) rc = GetLastError();
+    /* Remove it from the waiting list */
+    c->waiters = next;
+  }
+  LeaveCriticalSection(&c->lock);
+  return rc;
+}
+
+static DWORD st_condvar_broadcast(st_condvar c)
+{
+  DWORD rc = 0;
+  struct st_wait_list * curr, * next;
+
+  TRACE1("st_condvar_broadcast", c);
+  EnterCriticalSection(&c->lock);
+  /* Wake up all waiting threads */
+  curr = c->waiters;
+  while (curr != NULL) {
+    next = curr->next;
+    TRACE1("st_condvar_signal: waking up", curr->event);
+    if (! SetEvent(curr->event)) rc = GetLastError();
+    curr = next;
+  }
+  /* Remove them all from the waiting list */
+  c->waiters = NULL;
+  LeaveCriticalSection(&c->lock);
+  return rc;
+}
+
+static DWORD st_condvar_wait(st_condvar c, st_mutex m)
+{
+  HANDLE ev;
+  struct st_wait_list wait;
+
+  TRACE1("st_condvar_wait", c);
+  /* Recover (or create) the event associated with the calling thread */
+  ev = (HANDLE) TlsGetValue(st_thread_sem_key);
+  if (ev == 0) {
+    ev = CreateEvent(NULL,
+                     FALSE /*auto reset*/,
+                     FALSE /*initially unset*/,
+                     NULL);
+    if (ev == NULL) return GetLastError();
+    TlsSetValue(st_thread_sem_key, (void *) ev);
+  }
+  EnterCriticalSection(&c->lock);
+  /* Insert the current thread in the waiting list (atomically) */
+  wait.event = ev;
+  wait.next = c->waiters;
+  c->waiters = &wait;
+  LeaveCriticalSection(&c->lock);
+  /* Release the mutex m */
+  LeaveCriticalSection(m);
+  /* Wait for our event to be signaled.  There is no risk of lost
+     wakeup, since we inserted ourselves on the waiting list of c
+     before releasing m */
+  TRACE1("st_condvar_wait: blocking on event", ev);
+  if (WaitForSingleObject(ev, INFINITE) == WAIT_FAILED)
+    return GetLastError();
+  /* Reacquire the mutex m */
+  TRACE1("st_condvar_wait: restarted, acquiring mutex", m);
+  EnterCriticalSection(m);
+  TRACE1("st_condvar_wait: acquired mutex", m);
+  return 0;
+}
+
+/* Triggered events */
+
+typedef HANDLE st_event;
+
+static DWORD st_event_create(st_event * res)
+{
+  st_event m =
+    CreateEvent(NULL, TRUE/*manual reset*/, FALSE/*initially unset*/, NULL);
+  TRACE1("st_event_create", m);
+  if (m == NULL) return GetLastError();
+  *res = m;
+  return 0;
+}
+
+static DWORD st_event_destroy(st_event e)
+{
+  TRACE1("st_event_destroy", e);
+  if (CloseHandle(e))
+    return 0;
+  else
+    return GetLastError();
+}
+
+static DWORD st_event_trigger(st_event e)
+{
+  TRACE1("st_event_trigger", e);
+  if (SetEvent(e))
+    return 0;
+  else
+    return GetLastError();
+}
+
+static DWORD st_event_wait(st_event e)
+{
+  TRACE1("st_event_wait", e);
+  if (WaitForSingleObject(e, INFINITE) == WAIT_FAILED)
+    return GetLastError();
+  else
+    return 0;
+}
+
+/* Reporting errors */
+
+static void st_check_error(DWORD retcode, char * msg)
+{
+  char err[1024];
+  int errlen, msglen;
+  value str;
+
+  if (retcode == 0) return;
+  if (retcode == ERROR_NOT_ENOUGH_MEMORY) raise_out_of_memory();
+  if (! FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
+                     NULL,
+                     retcode,
+                     0,
+                     err,
+                     sizeof(err),
+                     NULL)) {
+    sprintf(err, "error code %lx", retcode);
+  }
+  msglen = strlen(msg);
+  errlen = strlen(err);
+  str = alloc_string(msglen + 2 + errlen);
+  memmove (&Byte(str, 0), msg, msglen);
+  memmove (&Byte(str, msglen), ": ", 2);
+  memmove (&Byte(str, msglen + 2), err, errlen);
+  raise_sys_error(str);
+}
+
+/* The tick thread: posts a SIGPREEMPTION signal periodically */
+
+static DWORD WINAPI caml_thread_tick(void * arg)
+{
+  while(1) {
+    Sleep(Thread_timeout);
+    /* The preemption signal should never cause a callback, so don't
+     go through caml_handle_signal(), just record signal delivery via
+     caml_record_signal(). */
+    caml_record_signal(SIGPREEMPTION);
+  }
+  return 0;                     /* prevents compiler warning */
+}
+
+/* "At fork" processing -- none under Win32 */
+
+static DWORD st_atfork(void (*fn)(void))
+{
+  return 0;
+}
+
+/* Signal handling -- none under Win32 */
+
+value caml_thread_sigmask(value cmd, value sigs) /* ML */
+{
+  invalid_argument("Thread.sigmask not implemented");
+  return Val_int(0);           /* not reached */
+}
+
+value caml_wait_signal(value sigs) /* ML */
+{
+  invalid_argument("Thread.wait_signal not implemented");
+  return Val_int(0);           /* not reached */
+}
diff --git a/otherlibs/systhreads/thread.ml b/otherlibs/systhreads/thread.ml
new file mode 100644 (file)
index 0000000..e7d528f
--- /dev/null
@@ -0,0 +1,79 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                         Objective Caml                              *)
+(*                                                                     *)
+(*  Xavier Leroy and Pascal Cuoq, projet Cristal, INRIA Rocquencourt   *)
+(*                                                                     *)
+(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
+(*  en Automatique.  All rights reserved.  This file is distributed    *)
+(*  under the terms of the GNU Library General Public License, with    *)
+(*  the special exception on linking described in file ../../LICENSE.  *)
+(*                                                                     *)
+(***********************************************************************)
+
+(* $Id: thread_posix.ml 9547 2010-01-22 12:48:24Z doligez $ *)
+
+(* User-level threads *)
+
+type t
+
+external thread_initialize : unit -> unit = "caml_thread_initialize"
+external thread_new : (unit -> unit) -> t = "caml_thread_new"
+external thread_uncaught_exception : exn -> unit =
+            "caml_thread_uncaught_exception"
+
+external yield : unit -> unit = "caml_thread_yield"
+external self : unit -> t = "caml_thread_self"
+external id : t -> int = "caml_thread_id"
+external join : t -> unit = "caml_thread_join"
+external exit : unit -> unit = "caml_thread_exit"
+
+(* For new, make sure the function passed to thread_new never
+   raises an exception. *)
+
+let create fn arg =
+  thread_new
+    (fun () ->
+      try
+        fn arg; ()
+      with exn ->
+             flush stdout; flush stderr;
+             thread_uncaught_exception exn)
+
+(* Thread.kill is currently not implemented due to problems with
+   cleanup handlers on several platforms *)
+
+let kill th = invalid_arg "Thread.kill: not implemented"
+
+(* Preemption *)
+
+let preempt signal = yield()
+
+(* Initialization of the scheduler *)
+
+let preempt_signal =
+  match Sys.os_type with
+  | "Win32" -> Sys.sigterm
+  | _       -> Sys.sigvtalrm
+
+let _ =
+  ignore(Sys.signal preempt_signal (Sys.Signal_handle preempt));
+  thread_initialize()
+
+(* Wait functions *)
+
+let delay time = ignore(Unix.select [] [] [] time)
+
+let wait_read fd = ()
+let wait_write fd = ()
+
+let wait_timed_read fd d =
+  match Unix.select [fd] [] [] d with ([], _, _) -> false | (_, _, _) -> true
+let wait_timed_write fd d =
+  match Unix.select [] [fd] [] d with (_, [], _) -> false | (_, _, _) -> true
+let select = Unix.select
+
+let wait_pid p = Unix.waitpid [] p
+
+external sigmask : Unix.sigprocmask_command -> int list -> int list = "caml_thread_sigmask"
+external wait_signal : int list -> int = "caml_wait_signal"
diff --git a/otherlibs/systhreads/thread_posix.ml b/otherlibs/systhreads/thread_posix.ml
deleted file mode 100644 (file)
index 9f077b3..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-(***********************************************************************)
-(*                                                                     *)
-(*                         Objective Caml                              *)
-(*                                                                     *)
-(*  Xavier Leroy and Pascal Cuoq, projet Cristal, INRIA Rocquencourt   *)
-(*                                                                     *)
-(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
-(*  en Automatique.  All rights reserved.  This file is distributed    *)
-(*  under the terms of the GNU Library General Public License, with    *)
-(*  the special exception on linking described in file ../../LICENSE.  *)
-(*                                                                     *)
-(***********************************************************************)
-
-(* $Id$ *)
-
-(* User-level threads *)
-
-type t
-
-external thread_initialize : unit -> unit = "caml_thread_initialize"
-external thread_new : (unit -> unit) -> t = "caml_thread_new"
-external thread_uncaught_exception : exn -> unit =
-            "caml_thread_uncaught_exception"
-
-external yield : unit -> unit = "caml_thread_yield"
-external self : unit -> t = "caml_thread_self"
-external id : t -> int = "caml_thread_id"
-external join : t -> unit = "caml_thread_join"
-external exit : unit -> unit = "caml_thread_exit"
-
-(* For new, make sure the function passed to thread_new never
-   raises an exception. *)
-
-let create fn arg =
-  thread_new
-    (fun () ->
-      try
-        fn arg; ()
-      with exn ->
-             flush stdout; flush stderr;
-             thread_uncaught_exception exn)
-
-(* Thread.kill is currently not implemented due to problems with
-   cleanup handlers on several platforms *)
-
-let kill th = invalid_arg "Thread.kill: not implemented"
-
-(* Preemption *)
-
-let preempt signal = yield()
-
-(* Initialization of the scheduler *)
-
-let _ =
-  ignore(Sys.signal Sys.sigvtalrm (Sys.Signal_handle preempt));
-  thread_initialize()
-
-(* Wait functions *)
-
-let delay time = ignore(Unix.select [] [] [] time)
-
-let wait_read fd = ()
-let wait_write fd = ()
-
-let wait_timed_read fd d =
-  match Unix.select [fd] [] [] d with ([], _, _) -> false | (_, _, _) -> true
-let wait_timed_write fd d =
-  match Unix.select [] [fd] [] d with (_, [], _) -> false | (_, _, _) -> true
-let select = Unix.select
-
-let wait_pid p = Unix.waitpid [] p
-
-external sigmask : Unix.sigprocmask_command -> int list -> int list = "caml_thread_sigmask"
-external wait_signal : int list -> int = "caml_wait_signal"
diff --git a/otherlibs/systhreads/thread_win32.ml b/otherlibs/systhreads/thread_win32.ml
deleted file mode 100644 (file)
index 3242231..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-(***********************************************************************)
-(*                                                                     *)
-(*                         Caml Special Light                          *)
-(*                                                                     *)
-(*  Xavier Leroy and Pascal Cuoq, projet Cristal, INRIA Rocquencourt   *)
-(*                                                                     *)
-(*  Copyright 1995 Institut National de Recherche en Informatique et   *)
-(*  en Automatique.  All rights reserved.  This file is distributed    *)
-(*  under the terms of the GNU Library General Public License, with    *)
-(*  the special exception on linking described in file ../../LICENSE.  *)
-(*                                                                     *)
-(***********************************************************************)
-
-(* $Id$ *)
-
-(* User-level threads *)
-
-type t
-
-external thread_initialize : unit -> unit = "caml_thread_initialize"
-external thread_new : (unit -> unit) -> t = "caml_thread_new"
-
-external yield : unit -> unit = "caml_thread_yield"
-external self : unit -> t = "caml_thread_self"
-external id : t -> int = "caml_thread_id"
-external join : t -> unit = "caml_thread_join"
-external thread_uncaught_exception : exn -> unit =
-            "caml_thread_uncaught_exception"
-
-(* For new, make sure the function passed to thread_new never
-   raises an exception. *)
-
-exception Thread_exit
-
-let create fn arg =
-  thread_new
-    (fun () ->
-      try
-        fn arg; ()
-      with Thread_exit -> ()
-         | exn ->
-             flush stdout; flush stderr;
-             thread_uncaught_exception exn)
-
-let exit () = raise Thread_exit
-
-(* Thread.kill is currently not implemented because there is no way
-   to do correct cleanup under Win32. *)
-
-let kill th = invalid_arg "Thread.kill: not implemented"
-
-(* Preemption *)
-
-let preempt signal = yield()
-
-(* Initialization of the scheduler *)
-
-let _ =
-  ignore(Sys.signal Sys.sigterm (Sys.Signal_handle preempt));
-  thread_initialize()
-
-(* Wait functions *)
-
-external delay: float -> unit = "caml_thread_delay"
-
-let wait_read fd = ()
-let wait_write fd = ()
-
-let wait_timed_read fd delay = true
-let wait_timed_write fd delay = true
-let select rd wr ex delay = invalid_arg "Thread.select: not implemented"
-
-let wait_pid p = Unix.waitpid [] p
-
-let sigmask cmd set = invalid_arg "Thread.sigmask: not implemented"
-let wait_signal set = invalid_arg "Thread.wait_signal: not implemented"
diff --git a/otherlibs/systhreads/threads.h b/otherlibs/systhreads/threads.h
new file mode 100644 (file)
index 0000000..7466242
--- /dev/null
@@ -0,0 +1,60 @@
+/***********************************************************************/
+/*                                                                     */
+/*                             Objective Caml                          */
+/*                                                                     */
+/*         Xavier Leroy and Damien Doligez, INRIA Rocquencourt         */
+/*                                                                     */
+/*  Copyright 1995 Institut National de Recherche en Informatique et   */
+/*  en Automatique.  All rights reserved.  This file is distributed    */
+/*  under the terms of the GNU Library General Public License, with    */
+/*  the special exception on linking described in file ../../LICENSE.  */
+/*                                                                     */
+/***********************************************************************/
+
+/* $Id: posix.c 9270 2009-05-20 11:52:42Z doligez $ */
+
+#ifndef CAML_THREADS_H
+#define CAML_THREADS_H
+
+CAMLextern void caml_enter_blocking_section (void);
+CAMLextern void caml_leave_blocking_section (void);
+#define caml_acquire_runtime_system caml_leave_blocking_section
+#define caml_release_runtime_system caml_enter_blocking_section
+
+/* Manage the master lock around the Caml run-time system.
+   Only one thread at a time can execute Caml compiled code or
+   Caml run-time system functions.
+
+   When Caml calls a C function, the current thread holds the master
+   lock.  The C function can release it by calling
+   [caml_release_runtime_system].  Then, another thread can execute Caml
+   code.  However, the calling thread must not access any Caml data,
+   nor call any runtime system function, nor call back into Caml.
+
+   Before returning to its Caml caller, or accessing Caml data,
+   or call runtime system functions, the current thread must
+   re-acquire the master lock by calling [caml_acquire_runtime_system].
+
+   Symmetrically, if a C function (not called from Caml) wishes to
+   call back into Caml code, it should invoke [caml_acquire_runtime_system]
+   first, then do the callback, then invoke [caml_release_runtime_system].
+
+   For historical reasons, alternate names can be used:
+     [caml_enter_blocking_section]  instead of  [caml_release_runtime_system]
+     [caml_leave_blocking_section]  instead of  [caml_acquire_runtime_system]
+   Intuition: a ``blocking section'' is a piece of C code that does not
+   use the runtime system (typically, a blocking I/O operation).
+*/
+
+CAMLextern int caml_c_thread_register(void);
+CAMLextern int caml_c_thread_unregister(void);
+
+/* If a thread is created by C code (instead of by Caml itself),
+   it must be registered with the Caml runtime system before
+   being able to call back into Caml code or use other runtime system
+   functions.  Just call [caml_c_thread_register] once.
+   Before the thread finishes, it must call [caml_c_thread_unregister].
+   Both functions return 1 on success, 0 on error.
+*/
+
+#endif /* CAML_THREADS_H */
diff --git a/otherlibs/systhreads/win32.c b/otherlibs/systhreads/win32.c
deleted file mode 100644 (file)
index dfec43c..0000000
+++ /dev/null
@@ -1,664 +0,0 @@
-/***********************************************************************/
-/*                                                                     */
-/*                         Objective Caml                              */
-/*                                                                     */
-/*           Xavier Leroy and Pascal Cuoq, INRIA Rocquencourt          */
-/*                                                                     */
-/*  Copyright 1995 Institut National de Recherche en Informatique et   */
-/*  en Automatique.  All rights reserved.  This file is distributed    */
-/*  under the terms of the GNU Library General Public License, with    */
-/*  the special exception on linking described in file ../../LICENSE.  */
-/*                                                                     */
-/***********************************************************************/
-
-/* $Id$ */
-
-/* Thread interface for Win32 threads */
-
-#include <windows.h>
-#include <process.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "alloc.h"
-#include "backtrace.h"
-#include "callback.h"
-#include "custom.h"
-#include "fail.h"
-#include "io.h"
-#include "memory.h"
-#include "misc.h"
-#include "mlvalues.h"
-#include "printexc.h"
-#include "roots.h"
-#include "signals.h"
-#ifdef NATIVE_CODE
-#include "stack.h"
-#else
-#include "stacks.h"
-#endif
-#include "sys.h"
-
-/* Initial size of stack when a thread is created (4 Ko) */
-#define Thread_stack_size (Stack_size / 4)
-
-/* Max computation time before rescheduling, in milliseconds (50ms) */
-#define Thread_timeout 50
-
-/* Signal used for timer preemption (any unused, legal signal number) */
-#define SIGTIMER SIGTERM
-
-/* The ML value describing a thread (heap-allocated) */
-
-struct caml_thread_handle {
-  value final_fun;              /* Finalization function */
-  HANDLE handle;                /* Windows handle */
-};
-
-struct caml_thread_descr {
-  value ident;                  /* Unique integer ID */
-  value start_closure;          /* The closure to start this thread */
-  struct caml_thread_handle * thread_handle; /* Finalized object with handle */
-};
-
-#define Ident(v) (((struct caml_thread_descr *)(v))->ident)
-#define Start_closure(v) (((struct caml_thread_descr *)(v))->start_closure)
-#define Threadhandle(v) (((struct caml_thread_descr *)(v))->thread_handle)
-
-/* The infos on threads (allocated via malloc()) */
-
-struct caml_thread_struct {
-  HANDLE wthread;               /* The Windows thread handle */
-  value descr;                  /* The heap-allocated descriptor (root) */
-  struct caml_thread_struct * next;  /* Double linking of running threads */
-  struct caml_thread_struct * prev;
-#ifdef NATIVE_CODE
-  char * bottom_of_stack;       /* Saved value of caml_bottom_of_stack */
-  uintnat last_retaddr;         /* Saved value of caml_last_return_address */
-  value * gc_regs;              /* Saved value of caml_gc_regs */
-  char * exception_pointer;     /* Saved value of caml_exception_pointer */
-  struct caml__roots_block * local_roots; /* Saved value of local_roots */
-#else
-  value * stack_low;            /* The execution stack for this thread */
-  value * stack_high;
-  value * stack_threshold;
-  value * sp;                   /* Saved value of extern_sp for this thread */
-  value * trapsp;               /* Saved value of trapsp for this thread */
-  struct caml__roots_block * local_roots; /* Saved value of local_roots */
-  struct longjmp_buffer * external_raise; /* Saved external_raise */
-  int backtrace_pos;            /* Saved backtrace_pos */
-  code_t * backtrace_buffer;    /* Saved backtrace_buffer */
-  value backtrace_last_exn;     /* Saved backtrace_last_exn (root) */
-#endif
-};
-
-typedef struct caml_thread_struct * caml_thread_t;
-
-/* The descriptor for the currently executing thread (thread-specific) */
-
-static caml_thread_t curr_thread = NULL;
-
-/* The global mutex used to ensure that at most one thread is running
-   Caml code */
-static HANDLE caml_mutex;
-
-/* The key used for storing the thread descriptor in the specific data
-   of the corresponding Posix thread. */
-static DWORD thread_descriptor_key;
-
-/* The key used for unlocking I/O channels on exceptions */
-static DWORD last_channel_locked_key;
-
-/* Identifier for next thread creation */
-static intnat thread_next_ident = 0;
-
-/* Forward declarations */
-
-static void caml_wthread_error (char * msg);
-
-/* Hook for scanning the stacks of the other threads */
-
-static void (*prev_scan_roots_hook) (scanning_action);
-
-static void caml_thread_scan_roots(scanning_action action)
-{
-  caml_thread_t th;
-
-  th = curr_thread;
-  do {
-    (*action)(th->descr, &th->descr);
-#ifndef NATIVE_CODE
-    (*action)(th->backtrace_last_exn, &th->backtrace_last_exn);
-#endif
-    /* Don't rescan the stack of the current thread, it was done already */
-    if (th != curr_thread) {
-#ifdef NATIVE_CODE
-      if (th->bottom_of_stack != NULL)
-        do_local_roots(action, th->bottom_of_stack, th->last_retaddr,
-                       th->gc_regs, th->local_roots);
-#else
-      do_local_roots(action, th->sp, th->stack_high, th->local_roots);
-#endif
-    }
-    th = th->next;
-  } while (th != curr_thread);
-  /* Hook */
-  if (prev_scan_roots_hook != NULL) (*prev_scan_roots_hook)(action);
-}
-
-/* Hooks for enter_blocking_section and leave_blocking_section */
-
-static void caml_thread_enter_blocking_section(void)
-{
-  /* Save the stack-related global variables in the thread descriptor
-     of the current thread */
-#ifdef NATIVE_CODE
-  curr_thread->bottom_of_stack = caml_bottom_of_stack;
-  curr_thread->last_retaddr = caml_last_return_address;
-  curr_thread->gc_regs = caml_gc_regs;
-  curr_thread->exception_pointer = caml_exception_pointer;
-  curr_thread->local_roots = local_roots;
-#else
-  curr_thread->stack_low = stack_low;
-  curr_thread->stack_high = stack_high;
-  curr_thread->stack_threshold = stack_threshold;
-  curr_thread->sp = extern_sp;
-  curr_thread->trapsp = trapsp;
-  curr_thread->local_roots = local_roots;
-  curr_thread->external_raise = external_raise;
-  curr_thread->backtrace_pos = backtrace_pos;
-  curr_thread->backtrace_buffer = backtrace_buffer;
-  curr_thread->backtrace_last_exn = backtrace_last_exn;
-#endif
-  /* Release the global mutex */
-  ReleaseMutex(caml_mutex);
-}
-
-static void caml_thread_leave_blocking_section(void)
-{
-  WaitForSingleObject(caml_mutex, INFINITE);
-  /* Update curr_thread to point to the thread descriptor corresponding
-     to the thread currently executing */
-  curr_thread = TlsGetValue(thread_descriptor_key);
-  /* Restore the stack-related global variables */
-#ifdef NATIVE_CODE
-  caml_bottom_of_stack= curr_thread->bottom_of_stack;
-  caml_last_return_address = curr_thread->last_retaddr;
-  caml_gc_regs = curr_thread->gc_regs;
-  caml_exception_pointer = curr_thread->exception_pointer;
-  local_roots = curr_thread->local_roots;
-#else
-  stack_low = curr_thread->stack_low;
-  stack_high = curr_thread->stack_high;
-  stack_threshold = curr_thread->stack_threshold;
-  extern_sp = curr_thread->sp;
-  trapsp = curr_thread->trapsp;
-  local_roots = curr_thread->local_roots;
-  external_raise = curr_thread->external_raise;
-  backtrace_pos = curr_thread->backtrace_pos;
-  backtrace_buffer = curr_thread->backtrace_buffer;
-  backtrace_last_exn = curr_thread->backtrace_last_exn;
-#endif
-}
-
-static int caml_thread_try_leave_blocking_section(void)
-{
-  /* Disable immediate processing of signals (PR#3659).
-     try_leave_blocking_section always fails, forcing the signal to be
-     recorded and processed at the next leave_blocking_section or
-     polling. */
-  return 0;
-}
-
-/* Hooks for I/O locking */
-
-static void caml_io_mutex_free(struct channel * chan)
-{
-  HANDLE mutex = chan->mutex;
-  if (mutex != NULL) {
-    CloseHandle(mutex);
-  }
-}
-
-static void caml_io_mutex_lock(struct channel * chan)
-{
-  if (chan->mutex == NULL) {
-    HANDLE mutex = CreateMutex(NULL, FALSE, NULL);
-    if (mutex == NULL) caml_wthread_error("Thread.iolock");
-    chan->mutex = (void *) mutex;
-  }
-  /* PR#4351: first try to acquire mutex without releasing the master lock */
-  if (WaitForSingleObject((HANDLE) chan->mutex, 0) == WAIT_OBJECT_0) {
-    TlsSetValue(last_channel_locked_key, (void *) chan);
-    return;
-  }
-  enter_blocking_section();
-  WaitForSingleObject((HANDLE) chan->mutex, INFINITE);
-  /* Problem: if a signal occurs at this point,
-     and the signal handler raises an exception, we will not
-     unlock the mutex.  The alternative (doing the setspecific
-     before locking the mutex is also incorrect, since we could
-     then unlock a mutex that is unlocked or locked by someone else. */
-  TlsSetValue(last_channel_locked_key, (void *) chan);
-  leave_blocking_section();
-}
-
-static void caml_io_mutex_unlock(struct channel * chan)
-{
-  ReleaseMutex((HANDLE) chan->mutex);
-  TlsSetValue(last_channel_locked_key, NULL);
-}
-
-static void caml_io_mutex_unlock_exn(void)
-{
-  struct channel * chan = TlsGetValue(last_channel_locked_key);
-  if (chan != NULL) caml_io_mutex_unlock(chan);
-}
-
-/* The "tick" thread fakes a signal at regular intervals. */
-
-static DWORD WINAPI caml_thread_tick(void * arg)
-{
-  while(1) {
-    Sleep(Thread_timeout);
-    caml_pending_signals[SIGTIMER] = 1;
-    caml_signals_are_pending = 1;
-#ifdef NATIVE_CODE
-    young_limit = young_end;
-#else
-    something_to_do = 1;
-#endif
-  }
-}
-
-static void caml_thread_finalize(value vthread)
-{
-  CloseHandle(((struct caml_thread_handle *)vthread)->handle);
-}
-
-/* Initialize the thread machinery */
-
-CAMLprim value caml_thread_initialize(value unit)
-{
-  value vthread = Val_unit;
-  value descr;
-  HANDLE tick_thread;
-  DWORD th_id;
-
-  /* Protect against repeated initialization (PR#1325) */
-  if (curr_thread != NULL) return Val_unit;
-  Begin_root (vthread);
-    /* Initialize the main mutex and acquire it */
-    caml_mutex = CreateMutex(NULL, TRUE, NULL);
-    if (caml_mutex == NULL) caml_wthread_error("Thread.init");
-    /* Initialize the TLS keys */
-    thread_descriptor_key = TlsAlloc();
-    last_channel_locked_key = TlsAlloc();
-    /* Create a finalized value to hold thread handle */
-    vthread = alloc_final(sizeof(struct caml_thread_handle) / sizeof(value),
-                          caml_thread_finalize, 1, 1000);
-    ((struct caml_thread_handle *)vthread)->handle = NULL;
-    /* Create a descriptor for the current thread */
-    descr = alloc_tuple(sizeof(struct caml_thread_descr) / sizeof(value));
-    Ident(descr) = Val_long(thread_next_ident);
-    Start_closure(descr) = Val_unit;
-    Threadhandle(descr) = (struct caml_thread_handle *) vthread;
-    thread_next_ident++;
-    /* Create an info block for the current thread */
-    curr_thread =
-      (caml_thread_t) stat_alloc(sizeof(struct caml_thread_struct));
-    DuplicateHandle(GetCurrentProcess(), GetCurrentThread(),
-                    GetCurrentProcess(), &(curr_thread->wthread),
-                    0, FALSE, DUPLICATE_SAME_ACCESS);
-    if (curr_thread->wthread == NULL) caml_wthread_error("Thread.init");
-    ((struct caml_thread_handle *)vthread)->handle = curr_thread->wthread;
-    curr_thread->descr = descr;
-    curr_thread->next = curr_thread;
-    curr_thread->prev = curr_thread;
-    /* The stack-related fields will be filled in at the next
-       enter_blocking_section */
-    /* Associate the thread descriptor with the thread */
-    TlsSetValue(thread_descriptor_key, (void *) curr_thread);
-    /* Set up the hooks */
-    prev_scan_roots_hook = scan_roots_hook;
-    scan_roots_hook = caml_thread_scan_roots;
-    enter_blocking_section_hook = caml_thread_enter_blocking_section;
-    leave_blocking_section_hook = caml_thread_leave_blocking_section;
-    try_leave_blocking_section_hook = caml_thread_try_leave_blocking_section;
-    caml_channel_mutex_free = caml_io_mutex_free;
-    caml_channel_mutex_lock = caml_io_mutex_lock;
-    caml_channel_mutex_unlock = caml_io_mutex_unlock;
-    caml_channel_mutex_unlock_exn = caml_io_mutex_unlock_exn;
-    /* Fork the tick thread */
-    tick_thread = CreateThread(NULL, 0, caml_thread_tick, NULL, 0, &th_id);
-    if (tick_thread == NULL) caml_wthread_error("Thread.init");
-    CloseHandle(tick_thread);
-  End_roots();
-  return Val_unit;
-}
-
-/* Create a thread */
-
-static DWORD WINAPI caml_thread_start(void * arg)
-{
-  caml_thread_t th = (caml_thread_t) arg;
-  value clos;
-
-  /* Associate the thread descriptor with the thread */
-  TlsSetValue(thread_descriptor_key, (void *) th);
-  TlsSetValue(last_channel_locked_key, NULL);
-  /* Acquire the global mutex and set up the stack variables */
-  leave_blocking_section();
-  /* Callback the closure */
-  clos = Start_closure(th->descr);
-  modify(&(Start_closure(th->descr)), Val_unit);
-  callback_exn(clos, Val_unit);
-  /* Remove th from the doubly-linked list of threads */
-  th->next->prev = th->prev;
-  th->prev->next = th->next;
-  /* Release the main mutex (forever) */
-  ReleaseMutex(caml_mutex);
-#ifndef NATIVE_CODE
-  /* Free the memory resources */
-  stat_free(th->stack_low);
-  if (th->backtrace_buffer != NULL) free(th->backtrace_buffer);
-#endif
-  /* Free the thread descriptor */
-  stat_free(th);
-  /* The thread now stops running */
-  return 0;
-}
-
-CAMLprim value caml_thread_new(value clos)
-{
-  caml_thread_t th;
-  value vthread = Val_unit;
-  value descr;
-  DWORD th_id;
-
-  Begin_roots2 (clos, vthread)
-    /* Create a finalized value to hold thread handle */
-    vthread = alloc_final(sizeof(struct caml_thread_handle) / sizeof(value),
-                          caml_thread_finalize, 1, 1000);
-    ((struct caml_thread_handle *)vthread)->handle = NULL;
-    /* Create a descriptor for the new thread */
-    descr = alloc_tuple(sizeof(struct caml_thread_descr) / sizeof(value));
-    Ident(descr) = Val_long(thread_next_ident);
-    Start_closure(descr) = clos;
-    Threadhandle(descr) = (struct caml_thread_handle *) vthread;
-    thread_next_ident++;
-    /* Create an info block for the current thread */
-    th = (caml_thread_t) stat_alloc(sizeof(struct caml_thread_struct));
-    th->descr = descr;
-#ifdef NATIVE_CODE
-    th->bottom_of_stack = NULL;
-    th->exception_pointer = NULL;
-    th->local_roots = NULL;
-#else
-    /* Allocate the stacks */
-    th->stack_low = (value *) stat_alloc(Thread_stack_size);
-    th->stack_high = th->stack_low + Thread_stack_size / sizeof(value);
-    th->stack_threshold = th->stack_low + Stack_threshold / sizeof(value);
-    th->sp = th->stack_high;
-    th->trapsp = th->stack_high;
-    th->local_roots = NULL;
-    th->external_raise = NULL;
-    th->backtrace_pos = 0;
-    th->backtrace_buffer = NULL;
-    th->backtrace_last_exn = Val_unit;
-#endif
-    /* Add thread info block to the list of threads */
-    th->next = curr_thread->next;
-    th->prev = curr_thread;
-    curr_thread->next->prev = th;
-    curr_thread->next = th;
-    /* Fork the new thread */
-    th->wthread =
-      CreateThread(NULL, 0, caml_thread_start, (void *) th, 0, &th_id);
-    if (th->wthread == NULL) {
-      /* Fork failed, remove thread info block from list of threads */
-      th->next->prev = curr_thread;
-      curr_thread->next = th->next;
-#ifndef NATIVE_CODE
-      stat_free(th->stack_low);
-#endif
-      stat_free(th);
-      caml_wthread_error("Thread.create");
-    }
-    ((struct caml_thread_handle *)vthread)->handle = th->wthread;
-  End_roots();
-  return descr;
-}
-
-/* Return the current thread */
-
-CAMLprim value caml_thread_self(value unit)
-{
-  if (curr_thread == NULL) invalid_argument("Thread.self: not initialized");
-  return curr_thread->descr;
-}
-
-/* Return the identifier of a thread */
-
-CAMLprim value caml_thread_id(value th)
-{
-  return Ident(th);
-}
-
-/* Print uncaught exception and backtrace */
-
-CAMLprim value caml_thread_uncaught_exception(value exn)
-{
-  char * msg = format_caml_exception(exn);
-  fprintf(stderr, "Thread %d killed on uncaught exception %s\n",
-          Int_val(Ident(curr_thread->descr)), msg);
-  free(msg);
-#ifndef NATIVE_CODE
-  if (backtrace_active) print_exception_backtrace();
-#endif
-  fflush(stderr);
-  return Val_unit;
-}
-
-/* Allow re-scheduling */
-
-CAMLprim value caml_thread_yield(value unit)
-{
-  enter_blocking_section();
-  Sleep(0);
-  leave_blocking_section();
-  return Val_unit;
-}
-
-/* Suspend the current thread until another thread terminates */
-
-CAMLprim value caml_thread_join(value th)
-{
-  HANDLE h;
-
-  Begin_root(th)                /* prevent deallocation of handle */
-    h = Threadhandle(th)->handle;
-    enter_blocking_section();
-    WaitForSingleObject(h, INFINITE);
-    leave_blocking_section();
-  End_roots();
-  return Val_unit;
-}
-
-/* Mutex operations */
-
-#define Mutex_val(v) (*((HANDLE *) Data_custom_val(v)))
-#define Max_mutex_number 1000
-
-static void caml_mutex_finalize(value mut)
-{
-  CloseHandle(Mutex_val(mut));
-}
-
-static int caml_mutex_compare(value wrapper1, value wrapper2)
-{
-  HANDLE h1 = Mutex_val(wrapper1);
-  HANDLE h2 = Mutex_val(wrapper2);
-  return h1 == h2 ? 0 : h1 < h2 ? -1 : 1;
-}
-
-static struct custom_operations caml_mutex_ops = {
-  "_mutex",
-  caml_mutex_finalize,
-  caml_mutex_compare,
-  custom_hash_default,
-  custom_serialize_default,
-  custom_deserialize_default
-};
-
-CAMLprim value caml_mutex_new(value unit)
-{
-  value mut;
-  mut = alloc_custom(&caml_mutex_ops, sizeof(HANDLE), 1, Max_mutex_number);
-  Mutex_val(mut) = CreateMutex(0, FALSE, NULL);
-  if (Mutex_val(mut) == NULL) caml_wthread_error("Mutex.create");
-  return mut;
-}
-
-CAMLprim value caml_mutex_lock(value mut)
-{
-  int retcode;
-  /* PR#4351: first try to acquire mutex without releasing the master lock */
-  retcode =  WaitForSingleObject(Mutex_val(mut), 0);
-  if (retcode == WAIT_OBJECT_0) return Val_unit;
-  Begin_root(mut)               /* prevent deallocation of mutex */
-    enter_blocking_section();
-    retcode = WaitForSingleObject(Mutex_val(mut), INFINITE);
-    leave_blocking_section();
-  End_roots();
-  if (retcode == WAIT_FAILED) caml_wthread_error("Mutex.lock");
-  return Val_unit;
-}
-
-CAMLprim value caml_mutex_unlock(value mut)
-{
-  BOOL retcode;
-  /* PR#4351: no need to release and reacquire master lock */
-  retcode = ReleaseMutex(Mutex_val(mut));
-  if (!retcode) caml_wthread_error("Mutex.unlock");
-  return Val_unit;
-}
-
-CAMLprim value caml_mutex_try_lock(value mut)
-{
-  int retcode;
-  retcode = WaitForSingleObject(Mutex_val(mut), 0);
-  if (retcode == WAIT_FAILED || retcode == WAIT_ABANDONED)
-    caml_wthread_error("Mutex.try_lock");
-  return Val_bool(retcode == WAIT_OBJECT_0);
-}
-
-/* Delay */
-
-CAMLprim value caml_thread_delay(value val)
-{
-  enter_blocking_section();
-  Sleep((DWORD)(Double_val(val)*1000)); /* milliseconds */
-  leave_blocking_section();
-  return Val_unit;
-}
-
-/* Conditions operations */
-
-struct caml_condvar {
-  uintnat count;          /* Number of waiting threads */
-  HANDLE sem;                   /* Semaphore on which threads are waiting */
-};
-
-#define Condition_val(v) ((struct caml_condvar *) Data_custom_val(v))
-#define Max_condition_number 1000
-
-static void caml_condition_finalize(value cond)
-{
-  CloseHandle(Condition_val(cond)->sem);
-}
-
-static int caml_condition_compare(value wrapper1, value wrapper2)
-{
-  HANDLE h1 = Condition_val(wrapper1)->sem;
-  HANDLE h2 = Condition_val(wrapper2)->sem;
-  return h1 == h2 ? 0 : h1 < h2 ? -1 : 1;
-}
-
-static struct custom_operations caml_condition_ops = {
-  "_condition",
-  caml_condition_finalize,
-  caml_condition_compare,
-  custom_hash_default,
-  custom_serialize_default,
-  custom_deserialize_default
-};
-
-CAMLprim value caml_condition_new(value unit)
-{
-  value cond;
-  cond = alloc_custom(&caml_condition_ops, sizeof(struct caml_condvar),
-                      1, Max_condition_number);
-  Condition_val(cond)->sem = CreateSemaphore(NULL, 0, 0x7FFFFFFF, NULL);
-  if (Condition_val(cond)->sem == NULL)
-    caml_wthread_error("Condition.create");
-  Condition_val(cond)->count = 0;
-  return cond;
-}
-
-CAMLprim value caml_condition_wait(value cond, value mut)
-{
-  int retcode;
-  HANDLE m = Mutex_val(mut);
-  HANDLE s = Condition_val(cond)->sem;
-  HANDLE handles[2];
-
-  Condition_val(cond)->count ++;
-  Begin_roots2(cond, mut)       /* prevent deallocation of cond and mutex */
-    enter_blocking_section();
-    /* Release mutex */
-    ReleaseMutex(m);
-    /* Wait for semaphore to be non-null, and decrement it.
-       Simultaneously, re-acquire mutex. */
-    handles[0] = s;
-    handles[1] = m;
-    retcode = WaitForMultipleObjects(2, handles, TRUE, INFINITE);
-    leave_blocking_section();
-  End_roots();
-  if (retcode == WAIT_FAILED) caml_wthread_error("Condition.wait");
-  return Val_unit;
-}
-
-CAMLprim value caml_condition_signal(value cond)
-{
-  HANDLE s = Condition_val(cond)->sem;
-
-  if (Condition_val(cond)->count > 0) {
-    Condition_val(cond)->count --;
-    /* Increment semaphore by 1, waking up one waiter */
-    ReleaseSemaphore(s, 1, NULL);
-  }
-  return Val_unit;
-}
-
-CAMLprim value caml_condition_broadcast(value cond)
-{
-  HANDLE s = Condition_val(cond)->sem;
-  uintnat c = Condition_val(cond)->count;
-
-  if (c > 0) {
-    Condition_val(cond)->count = 0;
-    /* Increment semaphore by c, waking up all waiters */
-    ReleaseSemaphore(s, c, NULL);
-  }
-  return Val_unit;
-}
-
-/* Error report */
-
-static void caml_wthread_error(char * msg)
-{
-  char errmsg[1024];
-  sprintf(errmsg, "%s: error code %lx", msg, GetLastError());
-  raise_sys_error(copy_string(errmsg));
-}
index ba507a093b6794b3e912e687feb3d7b7b233a53a..8adb2095fa82f162a073b791ed45a8c27d4e6ce2 100644 (file)
@@ -1,26 +1,14 @@
 scheduler.o: scheduler.c ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/misc.h ../../byterun/backtrace.h ../../byterun/mlvalues.h \
-  ../../byterun/callback.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/io.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/printexc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/roots.h \
-  ../../byterun/misc.h ../../byterun/memory.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/stacks.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h ../../byterun/sys.h \
-  ../../byterun/misc.h
+ ../../byterun/compatibility.h ../../byterun/misc.h \
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/backtrace.h ../../byterun/callback.h \
+ ../../byterun/config.h ../../byterun/fail.h ../../byterun/io.h \
+ ../../byterun/memory.h ../../byterun/gc.h ../../byterun/major_gc.h \
+ ../../byterun/freelist.h ../../byterun/minor_gc.h ../../byterun/misc.h \
+ ../../byterun/mlvalues.h ../../byterun/printexc.h ../../byterun/roots.h \
+ ../../byterun/memory.h ../../byterun/signals.h ../../byterun/stacks.h \
+ ../../byterun/sys.h
 condition.cmi: mutex.cmi
 event.cmi:
 marshal.cmi:
index 22ddf3e7b85030baa20985bead063a72c78945d6..cf80dc6992fd5f82d92004f39b46e5c0a31f7276 100644 (file)
 accept.o: accept.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h socketaddr.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/alloc.h \
+ ../../byterun/mlvalues.h ../../byterun/fail.h ../../byterun/memory.h \
+ ../../byterun/gc.h ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h ../../byterun/signals.h unixsupport.h \
+ socketaddr.h ../../byterun/misc.h
 access.o: access.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/alloc.h \
+ ../../byterun/mlvalues.h unixsupport.h
 addrofstr.o: addrofstr.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/fail.h ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h socketaddr.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/fail.h ../../byterun/mlvalues.h \
+ unixsupport.h socketaddr.h ../../byterun/misc.h
 alarm.o: alarm.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 bind.o: bind.c ../../byterun/fail.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/misc.h unixsupport.h socketaddr.h
+ ../../byterun/misc.h ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/mlvalues.h unixsupport.h socketaddr.h ../../byterun/misc.h
 chdir.o: chdir.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 chmod.o: chmod.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 chown.o: chown.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 chroot.o: chroot.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 close.o: close.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 closedir.o: closedir.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h unixsupport.h
 connect.o: connect.c ../../byterun/fail.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/misc.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h socketaddr.h
+ ../../byterun/misc.h ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/mlvalues.h ../../byterun/signals.h unixsupport.h \
+ socketaddr.h ../../byterun/misc.h
 cst2constr.o: cst2constr.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/fail.h ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h cst2constr.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/fail.h ../../byterun/mlvalues.h \
+ cst2constr.h
 cstringv.o: cstringv.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/memory.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/gc.h ../../byterun/mlvalues.h \
-  ../../byterun/major_gc.h ../../byterun/freelist.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/misc.h ../../byterun/minor_gc.h \
-  ../../byterun/misc.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/mlvalues.h ../../byterun/major_gc.h \
+ ../../byterun/freelist.h ../../byterun/minor_gc.h unixsupport.h
 dup.o: dup.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 dup2.o: dup2.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 envir.o: envir.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/alloc.h \
+ ../../byterun/mlvalues.h
 errmsg.o: errmsg.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/alloc.h \
+ ../../byterun/mlvalues.h
 execv.o: execv.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/memory.h \
+ ../../byterun/gc.h ../../byterun/mlvalues.h ../../byterun/major_gc.h \
+ ../../byterun/freelist.h ../../byterun/minor_gc.h unixsupport.h
 execve.o: execve.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/memory.h \
+ ../../byterun/gc.h ../../byterun/mlvalues.h ../../byterun/major_gc.h \
+ ../../byterun/freelist.h ../../byterun/minor_gc.h unixsupport.h
 execvp.o: execvp.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/memory.h \
+ ../../byterun/gc.h ../../byterun/mlvalues.h ../../byterun/major_gc.h \
+ ../../byterun/freelist.h ../../byterun/minor_gc.h unixsupport.h
 exit.o: exit.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 fchmod.o: fchmod.c ../../byterun/fail.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/misc.h unixsupport.h
+ ../../byterun/misc.h ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/mlvalues.h unixsupport.h
 fchown.o: fchown.c ../../byterun/fail.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/misc.h unixsupport.h
+ ../../byterun/misc.h ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/mlvalues.h unixsupport.h
 fcntl.o: fcntl.c ../../byterun/fail.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/misc.h unixsupport.h
+ ../../byterun/misc.h ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/mlvalues.h unixsupport.h
 fork.o: fork.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h \
+ ../../byterun/debugger.h ../../byterun/mlvalues.h unixsupport.h
 ftruncate.o: ftruncate.c ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/misc.h ../../byterun/io.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/misc.h \
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/mlvalues.h ../../byterun/io.h unixsupport.h
 getaddrinfo.o: getaddrinfo.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h cst2constr.h socketaddr.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/fail.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h ../../byterun/signals.h unixsupport.h \
+ cst2constr.h socketaddr.h ../../byterun/misc.h
 getcwd.o: getcwd.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/alloc.h \
+ ../../byterun/mlvalues.h ../../byterun/fail.h unixsupport.h
 getegid.o: getegid.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h unixsupport.h
 geteuid.o: geteuid.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h unixsupport.h
 getgid.o: getgid.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 getgr.o: getgr.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/fail.h \
+ ../../byterun/mlvalues.h ../../byterun/alloc.h ../../byterun/memory.h \
+ ../../byterun/gc.h ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h unixsupport.h
 getgroups.o: getgroups.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/fail.h unixsupport.h
 gethost.o: gethost.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h socketaddr.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/fail.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h ../../byterun/signals.h unixsupport.h \
+ socketaddr.h ../../byterun/misc.h
 gethostname.o: gethostname.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/fail.h unixsupport.h
 getlogin.o: getlogin.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ unixsupport.h
 getnameinfo.o: getnameinfo.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h socketaddr.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/fail.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h ../../byterun/signals.h unixsupport.h \
+ socketaddr.h ../../byterun/misc.h
 getpeername.o: getpeername.c ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/misc.h unixsupport.h socketaddr.h
+ ../../byterun/compatibility.h ../../byterun/misc.h \
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/mlvalues.h unixsupport.h socketaddr.h ../../byterun/misc.h
 getpid.o: getpid.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 getppid.o: getppid.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h unixsupport.h
 getproto.o: getproto.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/fail.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h unixsupport.h
 getpw.o: getpw.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/alloc.h \
+ ../../byterun/mlvalues.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h ../../byterun/fail.h unixsupport.h
 getserv.o: getserv.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/fail.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h unixsupport.h
 getsockname.o: getsockname.c ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/misc.h unixsupport.h socketaddr.h
+ ../../byterun/compatibility.h ../../byterun/misc.h \
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/mlvalues.h unixsupport.h socketaddr.h ../../byterun/misc.h
 gettimeofday.o: gettimeofday.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/fail.h unixsupport.h
 getuid.o: getuid.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 gmtime.o: gmtime.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/alloc.h \
+ ../../byterun/mlvalues.h ../../byterun/fail.h ../../byterun/memory.h \
+ ../../byterun/gc.h ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h unixsupport.h
 initgroups.o: initgroups.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/fail.h unixsupport.h
 isatty.o: isatty.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 itimer.o: itimer.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/alloc.h \
+ ../../byterun/mlvalues.h ../../byterun/fail.h ../../byterun/memory.h \
+ ../../byterun/gc.h ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h unixsupport.h
 kill.o: kill.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/fail.h \
+ ../../byterun/mlvalues.h unixsupport.h ../../byterun/signals.h
 link.o: link.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 listen.o: listen.c ../../byterun/fail.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/misc.h unixsupport.h
+ ../../byterun/misc.h ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/mlvalues.h unixsupport.h
 lockf.o: lockf.c ../../byterun/fail.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/misc.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/misc.h ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/mlvalues.h ../../byterun/signals.h unixsupport.h
 lseek.o: lseek.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/io.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/alloc.h \
+ ../../byterun/mlvalues.h ../../byterun/io.h unixsupport.h
 mkdir.o: mkdir.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 mkfifo.o: mkfifo.c ../../byterun/fail.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/misc.h unixsupport.h
+ ../../byterun/misc.h ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/mlvalues.h unixsupport.h
 nice.o: nice.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 open.o: open.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/alloc.h \
+ ../../byterun/mlvalues.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h ../../byterun/signals.h unixsupport.h
 opendir.o: opendir.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ unixsupport.h
 pipe.o: pipe.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/alloc.h \
+ ../../byterun/mlvalues.h unixsupport.h
 putenv.o: putenv.c ../../byterun/fail.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/misc.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/misc.h ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/memory.h ../../byterun/gc.h ../../byterun/major_gc.h \
+ ../../byterun/freelist.h ../../byterun/minor_gc.h \
+ ../../byterun/mlvalues.h unixsupport.h
 read.o: read.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/memory.h \
+ ../../byterun/gc.h ../../byterun/mlvalues.h ../../byterun/major_gc.h \
+ ../../byterun/freelist.h ../../byterun/minor_gc.h \
+ ../../byterun/signals.h unixsupport.h
 readdir.o: readdir.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/fail.h ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/fail.h ../../byterun/mlvalues.h \
+ ../../byterun/alloc.h unixsupport.h
 readlink.o: readlink.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/fail.h unixsupport.h
 rename.o: rename.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 rewinddir.o: rewinddir.c ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/misc.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/misc.h \
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/mlvalues.h unixsupport.h
 rmdir.o: rmdir.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 select.o: select.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/alloc.h \
+ ../../byterun/mlvalues.h ../../byterun/fail.h ../../byterun/memory.h \
+ ../../byterun/gc.h ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h ../../byterun/signals.h unixsupport.h
 sendrecv.o: sendrecv.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h socketaddr.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/fail.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h ../../byterun/signals.h unixsupport.h \
+ socketaddr.h ../../byterun/misc.h
 setgid.o: setgid.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 setgroups.o: setgroups.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/fail.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h unixsupport.h
 setsid.o: setsid.c ../../byterun/fail.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/misc.h unixsupport.h
+ ../../byterun/misc.h ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/mlvalues.h unixsupport.h
 setuid.o: setuid.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 shutdown.o: shutdown.c ../../byterun/fail.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/misc.h unixsupport.h
+ ../../byterun/misc.h ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/mlvalues.h unixsupport.h
 signals.o: signals.c ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/misc.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/misc.h ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/fail.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h ../../byterun/mlvalues.h \
+ ../../byterun/signals.h unixsupport.h
 sleep.o: sleep.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/signals.h \
+ ../../byterun/mlvalues.h unixsupport.h
 socket.o: socket.c ../../byterun/fail.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/misc.h unixsupport.h
+ ../../byterun/misc.h ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/mlvalues.h unixsupport.h
 socketaddr.o: socketaddr.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h unixsupport.h \
-  socketaddr.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/memory.h ../../byterun/gc.h ../../byterun/major_gc.h \
+ ../../byterun/freelist.h ../../byterun/minor_gc.h unixsupport.h \
+ socketaddr.h ../../byterun/misc.h
 socketpair.o: socketpair.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/fail.h unixsupport.h
 sockopt.o: sockopt.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/memory.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/gc.h ../../byterun/mlvalues.h \
-  ../../byterun/major_gc.h ../../byterun/freelist.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/misc.h ../../byterun/minor_gc.h \
-  ../../byterun/misc.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h socketaddr.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/mlvalues.h ../../byterun/major_gc.h \
+ ../../byterun/freelist.h ../../byterun/minor_gc.h ../../byterun/alloc.h \
+ ../../byterun/fail.h unixsupport.h socketaddr.h ../../byterun/misc.h
 stat.o: stat.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h cst2constr.h ../../byterun/io.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/memory.h \
+ ../../byterun/gc.h ../../byterun/mlvalues.h ../../byterun/major_gc.h \
+ ../../byterun/freelist.h ../../byterun/minor_gc.h ../../byterun/alloc.h \
+ unixsupport.h cst2constr.h ../../byterun/io.h
 strofaddr.o: strofaddr.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h socketaddr.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/fail.h unixsupport.h socketaddr.h ../../byterun/misc.h
 symlink.o: symlink.c ../../byterun/fail.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/misc.h unixsupport.h
+ ../../byterun/misc.h ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/mlvalues.h unixsupport.h
 termios.o: termios.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/fail.h unixsupport.h
 time.o: time.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/alloc.h \
+ ../../byterun/mlvalues.h unixsupport.h
 times.o: times.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/alloc.h \
+ ../../byterun/mlvalues.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h unixsupport.h
 truncate.o: truncate.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/fail.h ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/io.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/fail.h ../../byterun/mlvalues.h \
+ ../../byterun/io.h unixsupport.h
 umask.o: umask.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 unixsupport.o: unixsupport.c ../../byterun/mlvalues.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/../config/m.h ../../byterun/../config/s.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/compatibility.h ../../byterun/config.h \
-  ../../byterun/alloc.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/callback.h \
-  ../../byterun/compatibility.h ../../byterun/mlvalues.h \
-  ../../byterun/memory.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/gc.h ../../byterun/mlvalues.h \
-  ../../byterun/major_gc.h ../../byterun/freelist.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/misc.h ../../byterun/minor_gc.h \
-  ../../byterun/misc.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/fail.h ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h cst2constr.h
+ ../../byterun/compatibility.h ../../byterun/config.h \
+ ../../byterun/../config/m.h ../../byterun/../config/s.h \
+ ../../byterun/misc.h ../../byterun/alloc.h ../../byterun/mlvalues.h \
+ ../../byterun/callback.h ../../byterun/memory.h ../../byterun/gc.h \
+ ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h ../../byterun/fail.h unixsupport.h cst2constr.h
 unlink.o: unlink.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h unixsupport.h
 utimes.o: utimes.c ../../byterun/fail.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/misc.h unixsupport.h
+ ../../byterun/misc.h ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/mlvalues.h \
+ ../../byterun/mlvalues.h unixsupport.h
 wait.o: wait.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/alloc.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/fail.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/alloc.h \
+ ../../byterun/mlvalues.h ../../byterun/fail.h ../../byterun/memory.h \
+ ../../byterun/gc.h ../../byterun/major_gc.h ../../byterun/freelist.h \
+ ../../byterun/minor_gc.h ../../byterun/signals.h unixsupport.h
 write.o: write.c ../../byterun/mlvalues.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/../config/m.h \
-  ../../byterun/../config/s.h ../../byterun/compatibility.h \
-  ../../byterun/misc.h ../../byterun/compatibility.h \
-  ../../byterun/config.h ../../byterun/memory.h \
-  ../../byterun/compatibility.h ../../byterun/config.h ../../byterun/gc.h \
-  ../../byterun/mlvalues.h ../../byterun/major_gc.h \
-  ../../byterun/freelist.h ../../byterun/misc.h ../../byterun/mlvalues.h \
-  ../../byterun/misc.h ../../byterun/minor_gc.h ../../byterun/misc.h \
-  ../../byterun/misc.h ../../byterun/mlvalues.h ../../byterun/signals.h \
-  ../../byterun/compatibility.h ../../byterun/misc.h \
-  ../../byterun/mlvalues.h unixsupport.h
+ ../../byterun/config.h ../../byterun/../config/m.h \
+ ../../byterun/../config/s.h ../../byterun/misc.h ../../byterun/memory.h \
+ ../../byterun/gc.h ../../byterun/mlvalues.h ../../byterun/major_gc.h \
+ ../../byterun/freelist.h ../../byterun/minor_gc.h \
+ ../../byterun/signals.h unixsupport.h
 unix.cmi:
 unixLabels.cmi: unix.cmi
 unix.cmo: unix.cmi
index 428137dcbb930c0732eec6b1af26873300706dc9..74ec6294d020454bb78247b08c4e437f800bd790 100644 (file)
@@ -14,6 +14,7 @@
 /* $Id$ */
 
 #include <mlvalues.h>
+#include <debugger.h>
 #include "unixsupport.h"
 
 CAMLprim value unix_fork(value unit)
@@ -21,5 +22,9 @@ CAMLprim value unix_fork(value unit)
   int ret;
   ret = fork();
   if (ret == -1) uerror("fork", Nothing);
+  if (caml_debugger_in_use)
+    if ((caml_debugger_fork_mode && ret == 0) ||
+        (!caml_debugger_fork_mode && ret != 0))
+      caml_debugger_cleanup_fork();
   return Val_int(ret);
 }
diff --git a/otherlibs/win32graph/dllgraphics.dlib b/otherlibs/win32graph/dllgraphics.dlib
deleted file mode 100644 (file)
index ab0ba91..0000000
+++ /dev/null
@@ -1 +0,0 @@
-open.d.o draw.d.o events.d.o dib.d.o
diff --git a/otherlibs/win32unix/dllunix.dlib b/otherlibs/win32unix/dllunix.dlib
deleted file mode 100644 (file)
index e3ebf34..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# Files in this directory
-accept.d.o bind.d.o channels.d.o close.d.o
-close_on.d.o connect.d.o createprocess.d.o dup.d.o dup2.d.o errmsg.d.o
-getpeername.d.o getpid.d.o getsockname.d.o gettimeofday.d.o
-link.d.o listen.d.o lockf.d.o lseek.d.o nonblock.d.o
-mkdir.d.o open.d.o pipe.d.o read.d.o rename.d.o
-select.d.o sendrecv.d.o
-shutdown.d.o sleep.d.o socket.d.o sockopt.d.o startup.d.o stat.d.o
-system.d.o unixsupport.d.o windir.d.o winwait.d.o write.d.o
-winlist.d.o winworker.d.o windbug.d.o
-
-# Files from the ../unix directory
-access.d.o addrofstr.d.o chdir.d.o chmod.d.o cst2constr.d.o
-cstringv.d.o envir.d.o execv.d.o execve.d.o execvp.d.o
-exit.d.o getcwd.d.o gethost.d.o gethostname.d.o getproto.d.o
-getserv.d.o gmtime.d.o putenv.d.o rmdir.d.o
-socketaddr.d.o strofaddr.d.o time.d.o unlink.d.o utimes.d.o
index 6232e4fdc47743ff22d260cd0dbd435545abb251..87a5659611a1eee30bbe71c0cdfa85305e35fd54 100644 (file)
@@ -450,6 +450,8 @@ module_expr:
       { unclosed "(" 1 ")" 3 }
   | LPAREN VAL expr COLON package_type RPAREN
       { mkmod(Pmod_unpack($3, $5)) }
+  | LPAREN VAL expr COLON error
+      { unclosed "(" 1 ")" 5 }
 ;
 structure:
     structure_tail                              { $1 }
@@ -850,8 +852,6 @@ expr:
       { mkexp(Pexp_letmodule($3, $4, $6)) }
   | LET OPEN mod_longident IN seq_expr
       { mkexp(Pexp_open($3, $5)) }
-  | mod_longident DOT LPAREN seq_expr RPAREN
-      { mkexp(Pexp_open($1, $4)) }
   | FUNCTION opt_bar match_cases
       { mkexp(Pexp_function("", None, List.rev $3)) }
   | FUN labeled_simple_pattern fun_def
@@ -970,6 +970,10 @@ simple_expr:
       { let (t, t') = $3 in mkexp(Pexp_constraint($2, t, t')) }
   | simple_expr DOT label_longident
       { mkexp(Pexp_field($1, $3)) }
+  | mod_longident DOT LPAREN seq_expr RPAREN
+      { mkexp(Pexp_open($1, $4)) }
+  | mod_longident DOT LPAREN seq_expr error
+      { unclosed "(" 3 ")" 5 }
   | simple_expr DOT LPAREN seq_expr RPAREN
       { mkexp(Pexp_apply(ghexp(Pexp_ident(array_function "Array" "get")),
                          ["",$1; "",$4])) }
@@ -1014,6 +1018,8 @@ simple_expr:
       { mkexp(Pexp_send($1, $3)) }
   | LPAREN MODULE module_expr COLON package_type RPAREN
       { mkexp (Pexp_pack ($3, $5)) }
+  | LPAREN MODULE module_expr COLON error
+      { unclosed "(" 1 ")" 5 }
 ;
 simple_labeled_expr_list:
     labeled_simple_expr
index 1c7e2a3fea8beb599b942a6918406d5627c610d5..0267136b7102a9edc37c68d1e6f3f6b3b02b2d52 100644 (file)
@@ -144,3 +144,105 @@ sys.cmo: sys.cmi
 sys.cmx: sys.cmi
 weak.cmo: sys.cmi obj.cmi hashtbl.cmi array.cmi weak.cmi
 weak.cmx: sys.cmx obj.cmx hashtbl.cmx array.cmx weak.cmi
+arg.cmo: sys.cmi string.cmi printf.cmi list.cmi buffer.cmi array.cmi arg.cmi
+arg.p.cmx: sys.p.cmx string.p.cmx printf.p.cmx list.p.cmx buffer.p.cmx array.p.cmx arg.cmi
+array.cmo: array.cmi
+array.p.cmx: array.cmi
+arrayLabels.cmo: array.cmi arrayLabels.cmi
+arrayLabels.p.cmx: array.p.cmx arrayLabels.cmi
+buffer.cmo: sys.cmi string.cmi buffer.cmi
+buffer.p.cmx: sys.p.cmx string.p.cmx buffer.cmi
+callback.cmo: obj.cmi callback.cmi
+callback.p.cmx: obj.p.cmx callback.cmi
+camlinternalLazy.cmo: obj.cmi camlinternalLazy.cmi
+camlinternalLazy.p.cmx: obj.p.cmx camlinternalLazy.cmi
+camlinternalMod.cmo: obj.cmi camlinternalOO.cmi array.cmi camlinternalMod.cmi
+camlinternalMod.p.cmx: obj.p.cmx camlinternalOO.p.cmx array.p.cmx camlinternalMod.cmi
+camlinternalOO.cmo: sys.cmi string.cmi obj.cmi map.cmi list.cmi char.cmi \
+    array.cmi camlinternalOO.cmi
+camlinternalOO.p.cmx: sys.p.cmx string.p.cmx obj.p.cmx map.p.cmx list.p.cmx char.p.cmx \
+    array.p.cmx camlinternalOO.cmi
+char.cmo: char.cmi
+char.p.cmx: char.cmi
+complex.cmo: complex.cmi
+complex.p.cmx: complex.cmi
+digest.cmo: string.cmi printf.cmi digest.cmi
+digest.p.cmx: string.p.cmx printf.p.cmx digest.cmi
+filename.cmo: sys.cmi string.cmi random.cmi printf.cmi buffer.cmi \
+    filename.cmi
+filename.p.cmx: sys.p.cmx string.p.cmx random.p.cmx printf.p.cmx buffer.p.cmx \
+    filename.cmi
+format.cmo: string.cmi printf.cmi pervasives.cmi obj.cmi list.cmi buffer.cmi \
+    format.cmi
+format.p.cmx: string.p.cmx printf.p.cmx pervasives.p.cmx obj.p.cmx list.p.cmx buffer.p.cmx \
+    format.cmi
+gc.cmo: sys.cmi printf.cmi gc.cmi
+gc.p.cmx: sys.p.cmx printf.p.cmx gc.cmi
+genlex.cmo: string.cmi stream.cmi list.cmi hashtbl.cmi char.cmi genlex.cmi
+genlex.p.cmx: string.p.cmx stream.p.cmx list.p.cmx hashtbl.p.cmx char.p.cmx genlex.cmi
+hashtbl.cmo: sys.cmi array.cmi hashtbl.cmi
+hashtbl.p.cmx: sys.p.cmx array.p.cmx hashtbl.cmi
+int32.cmo: pervasives.cmi int32.cmi
+int32.p.cmx: pervasives.p.cmx int32.cmi
+int64.cmo: pervasives.cmi int64.cmi
+int64.p.cmx: pervasives.p.cmx int64.cmi
+lazy.cmo: obj.cmi camlinternalLazy.cmi lazy.cmi
+lazy.p.cmx: obj.p.cmx camlinternalLazy.p.cmx lazy.cmi
+lexing.cmo: sys.cmi string.cmi array.cmi lexing.cmi
+lexing.p.cmx: sys.p.cmx string.p.cmx array.p.cmx lexing.cmi
+list.cmo: list.cmi
+list.p.cmx: list.cmi
+listLabels.cmo: list.cmi listLabels.cmi
+listLabels.p.cmx: list.p.cmx listLabels.cmi
+map.cmo: map.cmi
+map.p.cmx: map.cmi
+marshal.cmo: string.cmi marshal.cmi
+marshal.p.cmx: string.p.cmx marshal.cmi
+moreLabels.cmo: set.cmi map.cmi hashtbl.cmi moreLabels.cmi
+moreLabels.p.cmx: set.p.cmx map.p.cmx hashtbl.p.cmx moreLabels.cmi
+nativeint.cmo: sys.cmi pervasives.cmi nativeint.cmi
+nativeint.p.cmx: sys.p.cmx pervasives.p.cmx nativeint.cmi
+obj.cmo: marshal.cmi int32.cmi array.cmi obj.cmi
+obj.p.cmx: marshal.p.cmx int32.p.cmx array.p.cmx obj.cmi
+oo.cmo: camlinternalOO.cmi oo.cmi
+oo.p.cmx: camlinternalOO.p.cmx oo.cmi
+parsing.cmo: obj.cmi lexing.cmi array.cmi parsing.cmi
+parsing.p.cmx: obj.p.cmx lexing.p.cmx array.p.cmx parsing.cmi
+pervasives.cmo: pervasives.cmi
+pervasives.p.cmx: pervasives.cmi
+printexc.cmo: printf.cmi obj.cmi buffer.cmi array.cmi printexc.cmi
+printexc.p.cmx: printf.p.cmx obj.p.cmx buffer.p.cmx array.p.cmx printexc.cmi
+printf.cmo: string.cmi pervasives.cmi obj.cmi list.cmi char.cmi buffer.cmi \
+    array.cmi printf.cmi
+printf.p.cmx: string.p.cmx pervasives.p.cmx obj.p.cmx list.p.cmx char.p.cmx buffer.p.cmx \
+    array.p.cmx printf.cmi
+queue.cmo: obj.cmi queue.cmi
+queue.p.cmx: obj.p.cmx queue.cmi
+random.cmo: string.cmi pervasives.cmi nativeint.cmi int64.cmi int32.cmi \
+    digest.cmi char.cmi array.cmi random.cmi
+random.p.cmx: string.p.cmx pervasives.p.cmx nativeint.p.cmx int64.p.cmx int32.p.cmx \
+    digest.p.cmx char.p.cmx array.p.cmx random.cmi
+scanf.cmo: string.cmi printf.cmi pervasives.cmi obj.cmi list.cmi hashtbl.cmi \
+    buffer.cmi array.cmi scanf.cmi
+scanf.p.cmx: string.p.cmx printf.p.cmx pervasives.p.cmx obj.p.cmx list.p.cmx hashtbl.p.cmx \
+    buffer.p.cmx array.p.cmx scanf.cmi
+set.cmo: set.cmi
+set.p.cmx: set.cmi
+sort.cmo: array.cmi sort.cmi
+sort.p.cmx: array.p.cmx sort.cmi
+stack.cmo: list.cmi stack.cmi
+stack.p.cmx: list.p.cmx stack.cmi
+stdLabels.cmo: stringLabels.cmi listLabels.cmi arrayLabels.cmi stdLabels.cmi
+stdLabels.p.cmx: stringLabels.p.cmx listLabels.p.cmx arrayLabels.p.cmx stdLabels.cmi
+std_exit.cmo:
+std_exit.p.cmx:
+stream.cmo: string.cmi obj.cmi list.cmi lazy.cmi stream.cmi
+stream.p.cmx: string.p.cmx obj.p.cmx list.p.cmx lazy.p.cmx stream.cmi
+string.cmo: pervasives.cmi list.cmi char.cmi string.cmi
+string.p.cmx: pervasives.p.cmx list.p.cmx char.p.cmx string.cmi
+stringLabels.cmo: string.cmi stringLabels.cmi
+stringLabels.p.cmx: string.p.cmx stringLabels.cmi
+sys.cmo: sys.cmi
+sys.p.cmx: sys.cmi
+weak.cmo: sys.cmi obj.cmi hashtbl.cmi array.cmi weak.cmi
+weak.p.cmx: sys.p.cmx obj.p.cmx hashtbl.p.cmx array.p.cmx weak.cmi
index a02650a6a0587f77525e8ff70f83c5a449020351..b4f47b4b88c10cc7e4c49a8ad0c9a210be2b237c 100755 (executable)
@@ -94,3 +94,4 @@ include .depend
 
 depend:
        $(CAMLDEP) *.mli *.ml > .depend
+       $(CAMLDEP) *.ml | sed -e 's/\.cmx/.p.cmx/g' >>.depend
index 429bf7dd62c7bca090aaaf5eb5bb332e5e7caef5..a8d6ec9e1486f0045f36d76a6878bb601e768daf 100644 (file)
@@ -817,9 +817,25 @@ let pp_get_all_formatter_output_functions state () =
    state.pp_output_newline, state.pp_output_spaces)
 ;;
 
+(* Default function to output new lines. *)
+let display_newline state () = state.pp_output_function "\n" 0  1;;
+
+(* Default function to output spaces. *)
+let blank_line = String.make 80 ' ';;
+let rec display_blanks state n =
+  if n > 0 then
+  if n <= 80 then state.pp_output_function blank_line 0 n else
+  begin
+    state.pp_output_function blank_line 0 80;
+    display_blanks state (n - 80)
+  end
+;;
+
 let pp_set_formatter_out_channel state os =
   state.pp_output_function <- output os;
-  state.pp_flush_function <- (fun () -> flush os)
+  state.pp_flush_function <- (fun () -> flush os);
+  state.pp_output_newline <- display_newline state;
+  state.pp_output_spaces <- display_blanks state;
 ;;
 
 (**************************************************************
@@ -873,20 +889,6 @@ let pp_make_formatter f g h i =
   }
 ;;
 
-(* Default function to output spaces. *)
-let blank_line = String.make 80 ' ';;
-let rec display_blanks state n =
-  if n > 0 then
-  if n <= 80 then state.pp_output_function blank_line 0 n else
-  begin
-    state.pp_output_function blank_line 0 80;
-    display_blanks state (n - 80)
-  end
-;;
-
-(* Default function to output new lines. *)
-let display_newline state () = state.pp_output_function "\n" 0  1;;
-
 (* Make a formatter with default functions to output spaces and new lines. *)
 let make_formatter output flush =
   let ppf = pp_make_formatter output flush ignore ignore in
@@ -1067,8 +1069,8 @@ let implode_rev s0 = function
 (* [mkprintf] is the printf-like function generator: given the
    - [to_s] flag that tells if we are printing into a string,
    - the [get_out] function that has to be called to get a [ppf] function to
-     output onto.
-   It generates a [kprintf] function that takes as arguments a [k]
+     output onto,
+   it generates a [kprintf] function that takes as arguments a [k]
    continuation function to be called at the end of formatting,
    and a printing format string to print the rest of the arguments
    according to the format string.
@@ -1309,24 +1311,31 @@ let ifprintf ppf = ikfprintf ignore ppf;;
 let printf fmt = fprintf std_formatter fmt;;
 let eprintf fmt = fprintf err_formatter fmt;;
 
+let ksprintf k =
+  let b = Buffer.create 512 in
+  let k ppf = k (string_out b ppf) in
+  mkprintf true (fun _ -> formatter_of_buffer b) k
+;;
+
+let sprintf fmt = ksprintf (fun s -> s) fmt;;
+
+(**************************************************************
+
+  Deprecated stuff.
+
+ **************************************************************)
+
 let kbprintf k b =
   mkprintf false (fun _ -> formatter_of_buffer b) k
 ;;
 
+(* Deprecated error prone function bprintf. *)
 let bprintf b =
   let k ppf = pp_flush_queue ppf false in
   kbprintf k b
 ;;
 
-let ksprintf k =
-  let b = Buffer.create 512 in
-  let k ppf = k (string_out b ppf) in
-  mkprintf true (fun _ -> formatter_of_buffer b) k
-;;
-
-let sprintf fmt = ksprintf (fun s -> s) fmt;;
-
-(* Obsolete alias for ksprintf. *)
+(* Deprecated alias for ksprintf. *)
 let kprintf = ksprintf;;
 
 at_exit print_flush
index 2998a0b289af6171cd187b49141aa0394a1c7b88..292f575884f30901a42ca196d71cd65a760ccc1b 100644 (file)
@@ -341,12 +341,16 @@ val get_mark_tags : unit -> bool;;
 (** {6 Redirecting the standard formatter output} *)
 
 val set_formatter_out_channel : Pervasives.out_channel -> unit;;
-(** Redirect the pretty-printer output to the given channel. *)
+(** Redirect the pretty-printer output to the given channel.
+    (All the output functions of the standard formatter are set to the
+     default output functions printing to the given channel.) *)
 
 val set_formatter_output_functions :
-  (string -> int -> int -> unit) -> (unit -> unit) -> unit;;
+  (string -> int -> int -> unit) -> (unit -> unit) -> unit
+;;
 (** [set_formatter_output_functions out flush] redirects the
-   pretty-printer output to the functions [out] and [flush].
+   relevant pretty-printer output functions to the functions [out] and
+   [flush].
 
    The [out] function performs the pretty-printer string output. It is called
    with a string [s], a start position [p], and a number of characters
@@ -356,7 +360,8 @@ val set_formatter_output_functions :
    or using low level function [print_flush] or [print_newline]). *)
 
 val get_formatter_output_functions :
-  unit -> (string -> int -> int -> unit) * (unit -> unit);;
+  unit -> (string -> int -> int -> unit) * (unit -> unit)
+;;
 (** Return the current output functions of the pretty-printer. *)
 
 (** {6:meaning Changing the meaning of standard formatter pretty printing} *)
@@ -372,6 +377,7 @@ val set_all_formatter_output_functions :
   newline:(unit -> unit) ->
   spaces:(int -> unit) ->
   unit
+;;
 (** [set_all_formatter_output_functions out flush outnewline outspace]
    redirects the pretty-printer output to the functions [out] and
    [flush] as described in [set_formatter_output_functions]. In
@@ -392,19 +398,21 @@ val get_all_formatter_output_functions :
   (string -> int -> int -> unit) *
   (unit -> unit) *
   (unit -> unit) *
-  (int -> unit);;
+  (int -> unit)
+;;
 (** Return the current output functions of the pretty-printer,
    including line breaking and indentation functions. Useful to record the
-  current setting and restore it afterwards. *)
+   current setting and restore it afterwards. *)
 
-(** {6 Changing the meaning of printing semantics tags} *)
+(** {6:tags Changing the meaning of printing semantics tags} *)
 
 type formatter_tag_functions = {
   mark_open_tag : tag -> string;
   mark_close_tag : tag -> string;
   print_open_tag : tag -> unit;
   print_close_tag : tag -> unit;
-};;
+}
+;;
 (** The tag handling functions specific to a formatter:
    [mark] versions are the ``tag marking'' functions that associate a string
    marker to a tag in order for the pretty-printing engine to flush
@@ -413,7 +421,8 @@ type formatter_tag_functions = {
    regular printing when a tag is closed or opened. *)
 
 val set_formatter_tag_functions :
-  formatter_tag_functions -> unit;;
+  formatter_tag_functions -> unit
+;;
 
 (** [set_formatter_tag_functions tag_funs] changes the meaning of
    opening and closing tags to use the functions in [tag_funs].
@@ -431,24 +440,29 @@ val set_formatter_tag_functions :
    material in the pretty-printer queue. *)
 
 val get_formatter_tag_functions :
-  unit -> formatter_tag_functions;;
+  unit -> formatter_tag_functions
+;;
 (** Return the current tag functions of the pretty-printer. *)
 
 (** {6 Multiple formatted output} *)
 
 type formatter;;
 (** Abstract data corresponding to a pretty-printer (also called a
-  formatter) and all its machinery.  Defining new pretty-printers permits the output of
-  material in parallel on several channels.
-  Parameters of a pretty-printer are local to this pretty-printer:
+  formatter) and all its machinery.
+
+  Defining new pretty-printers permits unrelated output of material in
+  parallel on several output channels.
+  All the parameters of a pretty-printer are local to this pretty-printer:
   margin, maximum indentation limit, maximum number of boxes
   simultaneously opened, ellipsis, and so on, are specific to
   each pretty-printer and may be fixed independently.
-  Given an output channel [oc], a new formatter writing to
-  that channel is obtained by calling [formatter_of_out_channel oc].
+  Given a [Pervasives.out_channel] output channel [oc], a new formatter
+  writing to that channel is simply obtained by calling
+  [formatter_of_out_channel oc].
   Alternatively, the [make_formatter] function allocates a new
   formatter with explicit output and flushing functions
-  (convenient to output material to strings for instance). *)
+  (convenient to output material to strings for instance).
+*)
 
 val formatter_of_out_channel : out_channel -> formatter;;
 (** [formatter_of_out_channel oc] returns a new formatter that
@@ -482,11 +496,12 @@ val flush_str_formatter : unit -> string;;
    the formatter and resets the corresponding buffer. *)
 
 val make_formatter :
-  (string -> int -> int -> unit) -> (unit -> unit) -> formatter;;
-(** [make_formatter out flush] returns a new formatter that
-   writes according to the output function [out], and the flushing
-   function [flush]. Hence, a formatter to the out channel [oc]
-   is returned by [make_formatter (output oc) (fun () -> flush oc)]. *)
+  (string -> int -> int -> unit) -> (unit -> unit) -> formatter
+;;
+(** [make_formatter out flush] returns a new formatter that writes according
+  to the output function [out], and the flushing function [flush]. For
+  instance, a formatter to the [Pervasives.out_channel] [oc] is returned by
+  [make_formatter (Pervasives.output oc) (fun () -> Pervasives.flush oc)]. *)
 
 (** {6 Basic functions to use with formatters} *)
 
@@ -532,20 +547,26 @@ val pp_set_ellipsis_text : formatter -> string -> unit;;
 val pp_get_ellipsis_text : formatter -> unit -> string;;
 val pp_set_formatter_out_channel : formatter -> Pervasives.out_channel -> unit;;
 val pp_set_formatter_output_functions :
-  formatter -> (string -> int -> int -> unit) -> (unit -> unit) -> unit;;
+  formatter -> (string -> int -> int -> unit) -> (unit -> unit) -> unit
+;;
 val pp_get_formatter_output_functions :
-  formatter -> unit -> (string -> int -> int -> unit) * (unit -> unit);;
+  formatter -> unit -> (string -> int -> int -> unit) * (unit -> unit)
+;;
 val pp_set_all_formatter_output_functions :
   formatter -> out:(string -> int -> int -> unit) -> flush:(unit -> unit) ->
-  newline:(unit -> unit) -> spaces:(int -> unit) -> unit;;
+  newline:(unit -> unit) -> spaces:(int -> unit) -> unit
+;;
 val pp_get_all_formatter_output_functions :
   formatter -> unit ->
   (string -> int -> int -> unit) * (unit -> unit) * (unit -> unit) *
-  (int -> unit);;
+  (int -> unit)
+;;
 val pp_set_formatter_tag_functions :
-  formatter -> formatter_tag_functions -> unit;;
+  formatter -> formatter_tag_functions -> unit
+;;
 val pp_get_formatter_tag_functions :
-  formatter -> unit -> formatter_tag_functions;;
+  formatter -> unit -> formatter_tag_functions
+;;
 (** These functions are the basic ones: usual functions
    operating on the standard formatter are defined via partial
    evaluation of these primitives. For instance,
@@ -554,13 +575,16 @@ val pp_get_formatter_tag_functions :
 (** {6 [printf] like functions for pretty-printing.} *)
 
 val fprintf : formatter -> ('a, formatter, unit) format -> 'a;;
-(** [fprintf ff format arg1 ... argN] formats the arguments
-   [arg1] to [argN] according to the format string [format],
-   and outputs the resulting string on the formatter [ff].
-   The format is a character string which contains three types of
-   objects: plain characters and conversion specifications as
-   specified in the [printf] module, and pretty-printing
-   indications.
+
+(** [fprintf ff fmt arg1 ... argN] formats the arguments [arg1] to [argN]
+   according to the format string [fmt], and outputs the resulting string on
+   the formatter [ff].
+
+   The format [fmt] is a character string which contains three types of
+   objects: plain characters and conversion specifications as specified in
+   the [Printf] module, and pretty-printing indications specific to the
+   [Format] module.
+
    The pretty-printing indication characters are introduced by
    a [@] character, and their meanings are:
    - [@\[]: open a pretty-printing box. The type and offset of the
@@ -621,10 +645,6 @@ val printf : ('a, formatter, unit) format -> 'a;;
 val eprintf : ('a, formatter, unit) format -> 'a;;
 (** Same as [fprintf] above, but output on [err_formatter]. *)
 
-val ifprintf : formatter -> ('a, formatter, unit) format -> 'a;;
-(** Same as [fprintf] above, but does not print anything.
-   Useful to ignore some material when conditionally printing. *)
-
 val sprintf : ('a, unit, string) format -> 'a;;
 (** Same as [printf] above, but instead of printing on a formatter,
    returns a string containing the result of formatting the arguments.
@@ -633,33 +653,28 @@ val sprintf : ('a, unit, string) format -> 'a;;
 
    In case of multiple and related calls to [sprintf] to output
    material on a single string, you should consider using [fprintf]
-   with a formatter writing to a buffer: flushing the buffer at the
-   end of pretty-printing returns the desired string. You can also use
-   the predefined formatter [str_formatter] and call
-   [flush_str_formatter ()] to get the result. *)
+   with the predefined formatter [str_formatter] and call
+   [flush_str_formatter ()] to get the final result.
 
-val bprintf : Buffer.t -> ('a, formatter, unit) format -> 'a;;
-(** Same as [sprintf] above, but instead of printing on a string,
-   writes into the given extensible buffer.
-   As for [sprintf], the pretty-printer queue is flushed at the end of each
-   call to [bprintf].
-
-   In case of multiple and related calls to [bprintf] to output
-   material on the same buffer [b], you should consider using
-   [fprintf] with a formatter writing to the buffer [b] (as obtained
-   by [formatter_of_buffer b]), otherwise the repeated flushes of the
-   pretty-printer queue would result in unexpected and badly formatted
-   output. *)
+   Alternatively, you can use [Format.fprintf] with a formatter writing to a
+   buffer of your own: flushing the formatter and the buffer at the end of
+   pretty-printing returns the desired string. *)
+
+val ifprintf : formatter -> ('a, formatter, unit) format -> 'a;;
+(** Same as [fprintf] above, but does not print anything.
+   Useful to ignore some material when conditionally printing. *)
 
 (** Formatted output functions with continuations. *)
 
 val kfprintf : (formatter -> 'a) -> formatter ->
-              ('b, formatter, unit, 'a) format4 -> 'b;;
+              ('b, formatter, unit, 'a) format4 -> 'b
+;;
 (** Same as [fprintf] above, but instead of returning immediately,
    passes the formatter to its first argument at the end of printing. *)
 
 val ikfprintf : (formatter -> 'a) -> formatter ->
-              ('b, formatter, unit, 'a) format4 -> 'b;;
+              ('b, formatter, unit, 'a) format4 -> 'b
+;;
 (** Same as [kfprintf] above, but does not print anything.
    Useful to ignore some material when conditionally printing. *)
 
@@ -667,5 +682,14 @@ val ksprintf : (string -> 'a) -> ('b, unit, string, 'a) format4 -> 'b;;
 (** Same as [sprintf] above, but instead of returning the string,
    passes it to the first argument. *)
 
+(** {6 Deprecated} *)
+
+val bprintf : Buffer.t -> ('a, formatter, unit) format -> 'a;;
+(** Deprecated and error prone function. Do not use it.
+
+  If you need to print to some buffer [b], you must first define a
+  formatter writing to [b], using [let to_b = formatter_of_buffer b]; then
+  use regular calls to [Format.fprintf] on formatter [to_b]. *)
+
 val kprintf : (string -> 'a) -> ('b, unit, string, 'a) format4 -> 'b;;
-(** A deprecated synonym for [ksprintf]. *)
+(** Deprecated name. A synonym for [ksprintf]. *)
index db98de978389feba60189a82573c48885b51de62..6482ebb78b7dc084d7196073aad5b02f2c7be534 100644 (file)
@@ -29,6 +29,7 @@ type stat = {
   fragments : int;
   compactions : int;
   top_heap_words : int;
+  stack_size : int;
 };;
 
 type control = {
index 809998c500876fb714866edf16820f46a356b532..b02b758c59eacd4f3b9495b5498eadcd1b674d7c 100644 (file)
@@ -70,6 +70,9 @@ type stat =
 
     top_heap_words : int;
     (** Maximum size reached by the major heap, in words. *)
+
+    stack_size: int;
+    (** Current size of the stack, in words. *)
 }
 (** The memory management counters are returned in a [stat] record.
 
@@ -221,7 +224,8 @@ val finalise : ('a -> unit) -> 'a -> unit
    The [f] function can use all features of O'Caml, including
    assignments that make the value reachable again.  It can also
    loop forever (in this case, the other
-   finalisation functions will be called during the execution of f).
+   finalisation functions will not be called during the execution of f,
+   unless it calls [finalise_release]).
    It can call [finalise] on [v] or other values to register other
    functions or even itself.  It can raise an exception; in this case
    the exception will interrupt whatever the program was doing when
index f0255c224d38c994de0322cd2abd6b48058a0555..3b85717f143241c4d284f0798ebc61a04e7d91da 100644 (file)
@@ -27,6 +27,9 @@ type 'a t = 'a lazy_t;;
    for the [lazy] keyword.  You should not use it directly.  Always use
    [Lazy.t] instead.
 
+   Note: [Lazy.force] is not thread-safe.  If you use this module in
+   a multi-threaded program, you will need to add some locks.
+
    Note: if the program is compiled with the [-rectypes] option,
    ill-founded recursive definitions of the form [let rec x = lazy x]
    or [let rec x = lazy(lazy(...(lazy x)))] are accepted by the type-checker
index 63da48c5699782461f4021e50ed72697f9169342..9e435c590b2b552fc8d0c845d7e571d97d6e1493 100644 (file)
@@ -42,25 +42,25 @@ let fields x =
   | n -> sprintf "(%s%s)" (field x 1) (other_fields x 2)
 ;;
 
-let to_string = function
-  | Out_of_memory -> "Out of memory"
-  | Stack_overflow -> "Stack overflow"
-  | Match_failure(file, line, char) ->
-      sprintf locfmt file line char (char+5) "Pattern matching failed"
-  | Assert_failure(file, line, char) ->
-      sprintf locfmt file line char (char+6) "Assertion failed"
-  | x ->
-      let rec conv = function
-        | hd :: tl ->
-            (match try hd x with _ -> None with
-            | Some s -> s
-            | None -> conv tl)
-        | [] ->
+let to_string x =
+  let rec conv = function
+    | hd :: tl ->
+        (match try hd x with _ -> None with
+        | Some s -> s
+        | None -> conv tl)
+    | [] ->
+        match x with
+        | Out_of_memory -> "Out of memory"
+        | Stack_overflow -> "Stack overflow"
+        | Match_failure(file, line, char) ->
+            sprintf locfmt file line char (char+5) "Pattern matching failed"
+        | Assert_failure(file, line, char) ->
+            sprintf locfmt file line char (char+6) "Assertion failed"
+        | _ ->
             let x = Obj.repr x in
             let constructor = (Obj.magic(Obj.field (Obj.field x 0) 0) : string) in
             constructor ^ (fields x) in
-      conv !printers
-;;
+  conv !printers
 
 let print fct arg =
   try
index 99729e10fd5082cc6392f62247f5b19ab9a393b6..166b4988942c6c613cb820666eb520c28a8fa267 100644 (file)
 
 (** Facilities for printing exceptions. *)
 
-val to_string : exn -> string
+val to_string: exn -> string
 (** [Printexc.to_string e] returns a string representation of
    the exception [e]. *)
 
-val print : ('a -> 'b) -> 'a -> 'b
+val print: ('a -> 'b) -> 'a -> 'b
 (** [Printexc.print fn x] applies [fn] to [x] and returns the result.
    If the evaluation of [fn x] raises any exception, the
    name of the exception is printed on standard error output,
@@ -27,7 +27,7 @@ val print : ('a -> 'b) -> 'a -> 'b
    The typical use is to catch and report exceptions that
    escape a function application. *)
 
-val catch : ('a -> 'b) -> 'a -> 'b
+val catch: ('a -> 'b) -> 'a -> 'b
 (** [Printexc.catch fn x] is similar to {!Printexc.print}, but
    aborts the program with exit code 2 after printing the
    uncaught exception.  This function is deprecated: the runtime
@@ -58,11 +58,13 @@ val backtrace_status: unit -> bool
 (** [Printexc.backtrace_status()] returns [true] if exception
     backtraces are currently recorded, [false] if not. *)
 
-val register_printer : (exn -> string option) -> unit
-(** [Printexc.register_printer fn] registers [fn] as an exception printer.
-    The printer should return [None] if it does not know how to convert
-    the passed exception, and [Some s] with [s] the resulting string if
-    it can convert the passed exception.
+val register_printer: (exn -> string option) -> unit
+(** [Printexc.register_printer fn] registers [fn] as an exception
+    printer.  The printer should return [None] or raise an exception
+    if it does not know how to convert the passed exception, and [Some
+    s] with [s] the resulting string if it can convert the passed
+    exception. Exceptions raised by the printer are ignored.
+
     When converting an exception into a string, the printers will be invoked
     in the reverse order of their registrations, until a printer returns
     a [Some s] value (if no such printer exists, the runtime will use a
index 1e62e4b8c5f414cca533c526117c3749f841084b..3d3d16c233b9c439ff8585ad3bb46e21fca3ceff 100644 (file)
 (* Scanning buffers. *)
 module type SCANNING = sig
 
-type in_channel;;
-
-type scanbuf = in_channel;;
-
-val stdin : in_channel;;
-(* The scanning buffer reading from [Pervasives.stdin].
-    [stdib] is equivalent to [Scanning.from_channel Pervasives.stdin]. *)
-
-val stdib : in_channel;;
-(* An alias for [Scanf.stdin], the scanning buffer reading from
-   [Pervasives.stdin]. *)
-
-val next_char : scanbuf -> char;;
-(* [Scanning.next_char ib] advance the scanning buffer for
-    one character.
-    If no more character can be read, sets a end of file condition and
-    returns '\000'. *)
-
-val invalidate_current_char : scanbuf -> unit;;
-(* [Scanning.invalidate_current_char ib] mark the current_char as already
-    scanned. *)
-
-val peek_char : scanbuf -> char;;
-(* [Scanning.peek_char ib] returns the current char available in
-    the buffer or reads one if necessary (when the current character is
-    already scanned).
-    If no character can be read, sets an end of file condition and
-    returns '\000'. *)
-
-val checked_peek_char : scanbuf -> char;;
-(* Same as above but always returns a valid char or fails:
-    instead of returning a null char when the reading method of the
-    input buffer has reached an end of file, the function raises exception
-    [End_of_file]. *)
-
-val store_char : int -> scanbuf -> char -> int;;
-(* [Scanning.store_char lim ib c] adds [c] to the token buffer
-    of the scanning buffer. It also advances the scanning buffer for one
-    character and returns [lim - 1], indicating the new limit
-    for the length of the current token. *)
-
-val skip_char : int -> scanbuf -> int;;
-(* [Scanning.skip_char lim ib] ignores the current character. *)
-
-val ignore_char : int -> scanbuf -> int;;
-(* [Scanning.ignore_char ib lim] ignores the current character and
-   decrements the limit. *)
-
-val token : scanbuf -> string;;
-(* [Scanning.token ib] returns the string stored into the token
-    buffer of the scanning buffer: it returns the token matched by the
-    format. *)
-
-val reset_token : scanbuf -> unit;;
-(* [Scanning.reset_token ib] resets the token buffer of
-    the given scanning buffer. *)
-
-val char_count : scanbuf -> int;;
-(* [Scanning.char_count ib] returns the number of characters
-    read so far from the given buffer. *)
-
-val line_count : scanbuf -> int;;
-(* [Scanning.line_count ib] returns the number of new line
-    characters read so far from the given buffer. *)
-
-val token_count : scanbuf -> int;;
-(* [Scanning.token_count ib] returns the number of tokens read
-    so far from [ib]. *)
-
-val eof : scanbuf -> bool;;
-(* [Scanning.eof ib] returns the end of input condition
-    of the given buffer. *)
-
-val end_of_input : scanbuf -> bool;;
-(* [Scanning.end_of_input ib] tests the end of input condition
-    of the given buffer (if no char has ever been read, an attempt to
-    read one is performed). *)
-
-val beginning_of_input : scanbuf -> bool;;
-(* [Scanning.beginning_of_input ib] tests the beginning of input
-    condition of the given buffer. *)
-
-val name_of_input : scanbuf -> string;;
-(* [Scanning.name_of_input ib] returns the name of the character
-    source for input buffer [ib]. *)
-
-val open_in : string -> scanbuf;;
-val open_in_bin : string -> scanbuf;;
-val from_file : string -> scanbuf;;
-val from_file_bin : string -> scanbuf;;
-val from_string : string -> scanbuf;;
-val from_function : (unit -> char) -> scanbuf;;
-val from_channel : Pervasives.in_channel -> scanbuf;;
-
-val close_in : scanbuf -> unit;;
+  type in_channel;;
+
+  type scanbuf = in_channel;;
+
+  val stdin : in_channel;;
+  (* The scanning buffer reading from [Pervasives.stdin].
+      [stdib] is equivalent to [Scanning.from_channel Pervasives.stdin]. *)
+
+  val stdib : in_channel;;
+  (* An alias for [Scanf.stdin], the scanning buffer reading from
+     [Pervasives.stdin]. *)
+
+  val next_char : scanbuf -> char;;
+  (* [Scanning.next_char ib] advance the scanning buffer for
+      one character.
+      If no more character can be read, sets a end of file condition and
+      returns '\000'. *)
+
+  val invalidate_current_char : scanbuf -> unit;;
+  (* [Scanning.invalidate_current_char ib] mark the current_char as already
+      scanned. *)
+
+  val peek_char : scanbuf -> char;;
+  (* [Scanning.peek_char ib] returns the current char available in
+      the buffer or reads one if necessary (when the current character is
+      already scanned).
+      If no character can be read, sets an end of file condition and
+      returns '\000'. *)
+
+  val checked_peek_char : scanbuf -> char;;
+  (* Same as above but always returns a valid char or fails:
+      instead of returning a null char when the reading method of the
+      input buffer has reached an end of file, the function raises exception
+      [End_of_file]. *)
+
+  val store_char : int -> scanbuf -> char -> int;;
+  (* [Scanning.store_char lim ib c] adds [c] to the token buffer
+      of the scanning buffer. It also advances the scanning buffer for one
+      character and returns [lim - 1], indicating the new limit
+      for the length of the current token. *)
+
+  val skip_char : int -> scanbuf -> int;;
+  (* [Scanning.skip_char lim ib] ignores the current character. *)
+
+  val ignore_char : int -> scanbuf -> int;;
+  (* [Scanning.ignore_char ib lim] ignores the current character and
+     decrements the limit. *)
+
+  val token : scanbuf -> string;;
+  (* [Scanning.token ib] returns the string stored into the token
+      buffer of the scanning buffer: it returns the token matched by the
+      format. *)
+
+  val reset_token : scanbuf -> unit;;
+  (* [Scanning.reset_token ib] resets the token buffer of
+      the given scanning buffer. *)
+
+  val char_count : scanbuf -> int;;
+  (* [Scanning.char_count ib] returns the number of characters
+      read so far from the given buffer. *)
+
+  val line_count : scanbuf -> int;;
+  (* [Scanning.line_count ib] returns the number of new line
+      characters read so far from the given buffer. *)
+
+  val token_count : scanbuf -> int;;
+  (* [Scanning.token_count ib] returns the number of tokens read
+      so far from [ib]. *)
+
+  val eof : scanbuf -> bool;;
+  (* [Scanning.eof ib] returns the end of input condition
+      of the given buffer. *)
+
+  val end_of_input : scanbuf -> bool;;
+  (* [Scanning.end_of_input ib] tests the end of input condition
+      of the given buffer (if no char has ever been read, an attempt to
+      read one is performed). *)
+
+  val beginning_of_input : scanbuf -> bool;;
+  (* [Scanning.beginning_of_input ib] tests the beginning of input
+      condition of the given buffer. *)
+
+  val name_of_input : scanbuf -> string;;
+  (* [Scanning.name_of_input ib] returns the name of the character
+      source for input buffer [ib]. *)
+
+  val open_in : string -> scanbuf;;
+  val open_in_bin : string -> scanbuf;;
+  val from_file : string -> scanbuf;;
+  val from_file_bin : string -> scanbuf;;
+  val from_string : string -> scanbuf;;
+  val from_function : (unit -> char) -> scanbuf;;
+  val from_channel : Pervasives.in_channel -> scanbuf;;
+
+  val close_in : scanbuf -> unit;;
 
 end
 ;;
 
 module Scanning : SCANNING = struct
 
-(* The run-time library for scanf. *)
-type in_channel_name =
-  | From_file of string * Pervasives.in_channel
-  | From_string
-  | From_function
-  | From_channel of Pervasives.in_channel
-;;
-
-type in_channel = {
-  mutable eof : bool;
-  mutable current_char : char;
-  mutable current_char_is_valid : bool;
-  mutable char_count : int;
-  mutable line_count : int;
-  mutable token_count : int;
-  mutable get_next_char : unit -> char;
-  tokbuf : Buffer.t;
-  input_name : in_channel_name;
-}
-;;
-
-type scanbuf = in_channel;;
-
-let null_char = '\000';;
-
-(* Reads a new character from input buffer.  Next_char never fails,
-   even in case of end of input: it then simply sets the end of file
-   condition. *)
-let next_char ib =
-  try
-    let c = ib.get_next_char () in
-    ib.current_char <- c;
-    ib.current_char_is_valid <- true;
-    ib.char_count <- succ ib.char_count;
-    if c = '\n' then ib.line_count <- succ ib.line_count;
-    c with
-  | End_of_file ->
-    let c = null_char in
-    ib.current_char <- c;
-    ib.current_char_is_valid <- false;
-    ib.eof <- true;
+  (* The run-time library for scanf. *)
+  type in_channel_name =
+    | From_file of string * Pervasives.in_channel
+    | From_string
+    | From_function
+    | From_channel of Pervasives.in_channel
+  ;;
+
+  type in_channel = {
+    mutable eof : bool;
+    mutable current_char : char;
+    mutable current_char_is_valid : bool;
+    mutable char_count : int;
+    mutable line_count : int;
+    mutable token_count : int;
+    mutable get_next_char : unit -> char;
+    tokbuf : Buffer.t;
+    input_name : in_channel_name;
+  }
+  ;;
+
+  type scanbuf = in_channel;;
+
+  let null_char = '\000';;
+
+  (* Reads a new character from input buffer.  Next_char never fails,
+     even in case of end of input: it then simply sets the end of file
+     condition. *)
+  let next_char ib =
+    try
+      let c = ib.get_next_char () in
+      ib.current_char <- c;
+      ib.current_char_is_valid <- true;
+      ib.char_count <- succ ib.char_count;
+      if c = '\n' then ib.line_count <- succ ib.line_count;
+      c with
+    | End_of_file ->
+      let c = null_char in
+      ib.current_char <- c;
+      ib.current_char_is_valid <- false;
+      ib.eof <- true;
+      c
+  ;;
+
+  let peek_char ib =
+    if ib.current_char_is_valid then ib.current_char else next_char ib;;
+
+  (* Returns a valid current char for the input buffer. In particular
+     no irrelevant null character (as set by [next_char] in case of end
+     of input) is returned, since [End_of_file] is raised when
+     [next_char] sets the end of file condition while trying to read a
+     new character. *)
+  let checked_peek_char ib =
+    let c = peek_char ib in
+    if ib.eof then raise End_of_file;
     c
-;;
-
-let peek_char ib =
-  if ib.current_char_is_valid then ib.current_char else next_char ib;;
-
-(* Returns a valid current char for the input buffer. In particular
-   no irrelevant null character (as set by [next_char] in case of end
-   of input) is returned, since [End_of_file] is raised when
-   [next_char] sets the end of file condition while trying to read a
-   new character. *)
-let checked_peek_char ib =
-  let c = peek_char ib in
-  if ib.eof then raise End_of_file;
-  c
-;;
-
-let end_of_input ib =
-  ignore (peek_char ib);
-  ib.eof
-;;
-
-let eof ib = ib.eof;;
-
-let beginning_of_input ib = ib.char_count = 0;;
-let name_of_input ib =
-  match ib.input_name with
-  | From_file (fname, _ic) -> fname
-  | From_string -> "unnamed character string"
-  | From_function -> "unnamed function"
-  | From_channel _ic -> "unnamed pervasives input channel"
-;;
-
-let char_count ib =
-  if ib.current_char_is_valid then ib.char_count - 1 else ib.char_count
-;;
-let line_count ib = ib.line_count;;
-let reset_token ib = Buffer.reset ib.tokbuf;;
-let invalidate_current_char ib = ib.current_char_is_valid <- false;;
-
-let token ib =
-  let tokbuf = ib.tokbuf in
-  let tok = Buffer.contents tokbuf in
-  Buffer.clear tokbuf;
-  ib.token_count <- succ ib.token_count;
-  tok
-;;
-
-let token_count ib = ib.token_count;;
-
-let skip_char max ib =
-  invalidate_current_char ib;
-  max
-;;
-
-let ignore_char max ib = skip_char (max - 1) ib;;
-
-let store_char max ib c =
-  Buffer.add_char ib.tokbuf c;
-  ignore_char max ib
-;;
-
-let default_token_buffer_size = 1024;;
-
-let create iname next = {
-  eof = false;
-  current_char = null_char;
-  current_char_is_valid = false;
-  char_count = 0;
-  line_count = 0;
-  token_count = 0;
-  get_next_char = next;
-  tokbuf = Buffer.create default_token_buffer_size;
-  input_name = iname;
-}
-;;
-
-let from_string s =
-  let i = ref 0 in
-  let len = String.length s in
-  let next () =
-    if !i >= len then raise End_of_file else
-    let c = s.[!i] in
-    incr i;
-    c in
-  create From_string next
-;;
-
-let from_function = create From_function;;
-
-(* Scanning from an input channel. *)
-
-(* Position of the problem:
-
-   We cannot prevent the scanning mechanism to use one lookahead character,
-   if needed by the semantics of the format string specifications (e.g. a
-   trailing ``skip space'' specification in the format string); in this case,
-   the mandatory lookahead character is indeed read from the input and not
-   used to return the token read. It is thus mandatory to be able to store
-   an unused lookahead character somewhere to get it as the first character
-   of the next scan.
-
-   To circumvent this problem, all the scanning functions get a low level
-   input buffer argument where they store the lookahead character when
-   needed; additionally, the input buffer is the only source of character of
-   a scanner. The [scanbuf] input buffers are defined in module {!Scanning}.
-
-   Now we understand that it is extremely important that related successive
-   calls to scanners indeed read from the same input buffer. In effect, if a
-   scanner [scan1] is reading from [ib1] and stores an unused lookahead
-   character [c1] into its input buffer [ib1], then another scanner [scan2]
-   not reading from the same buffer [ib1] will miss the character [c],
-   seemingly vanished in the air from the point of view of [scan2].
-
-   This mechanism works perfectly to read from strings, from files, and from
-   functions, since in those cases, allocating two buffers reading from the
-   same source is unnatural.
-
-   Still, there is a difficulty in the case of scanning from an input
-   channel. In effect, when scanning from an input channel [ic], this channel
-   may not have been allocated from within this library. Hence, it may be
-   shared (two functions of the user's program may successively read from
-   [ic]). This is highly error prone since, one of the function may seek the
-   input channel, while the other function has still an unused lookahead
-   character in its input buffer. In conclusion, you should never mix direct
-   low level reading and high level scanning from the same input channel.
-
-   This phenomenon of reading mess is even worse when one defines more than
-   one scanning buffer reading from the same input channel
-   [ic]. Unfortunately, we have no simple way to get rid of this problem
-   (unless the basic input channel API is modified to offer a ``consider this
-   char as unread'' procedure to keep back the unused lookahead character as
-   available in the input channel for further reading).
-
-   To prevent some of the confusion the scanning buffer allocation function
-   is a memo function that never allocates two different scanning buffers for
-   the same input channel. This way, the user can naively perform successive
-   call to [fscanf] below, without allocating a new scanning buffer at each
-   invocation and hence preserving the expected semantics.
-
-   As mentioned above, a more ambitious fix could be to change the input
-   channel API to allow arbitrary mixing of direct and formatted reading from
-   input channels. *)
-
-(* Perform bufferized input to improve efficiency. *)
-let file_buffer_size = ref 1024;;
-
-(* The scanner closes the input channel at end of input. *)
-let scan_close_at_end ic = close_in ic; raise End_of_file;;
-
-(* The scanner does not close the input channel at end of input:
-   it just raises [End_of_file]. *)
-let scan_raise_at_end _ic = raise End_of_file;;
-
-let from_ic scan_close_ic iname ic =
-  let len = !file_buffer_size in
-  let buf = String.create len in
-  let i = ref 0 in
-  let lim = ref 0 in
-  let eof = ref false in
-  let next () =
-    if !i < !lim then begin let c = buf.[!i] in incr i; c end else
-    if !eof then raise End_of_file else begin
-      lim := input ic buf 0 len;
-      if !lim = 0 then begin eof := true; scan_close_ic ic end else begin
-        i := 1;
-        buf.[0]
-      end
-    end in
-  create iname next
-;;
-
-let from_ic_close_at_end = from_ic scan_close_at_end;;
-
-(* The scanning buffer reading from [Pervasives.stdin].
-   One could try to define [stdib] as a scanning buffer reading a character at a
-   time (no bufferization at all), but unfortunately the top-level
-   interaction would be wrong.
-   This is due to some kind of ``race condition'' when reading from [Pervasives.stdin],
-   since the interactive compiler and [scanf] will simultaneously read the
-   material they need from [Pervasives.stdin]; then, confusion will result from what should
-   be read by the top-level and what should be read by [scanf].
-   This is even more complicated by the one character lookahead that [scanf]
-   is sometimes obliged to maintain: the lookahead character will be available
-   for the next ([scanf]) entry, seemingly coming from nowhere.
-   Also no [End_of_file] is raised when reading from stdin: if not enough
-   characters have been read, we simply ask to read more. *)
-let stdin =
-  from_ic scan_raise_at_end
-    (From_file ("-", Pervasives.stdin)) Pervasives.stdin
-;;
-
-let stdib = stdin;;
-
-let open_in fname =
-  match fname with
-  | "-" -> stdin
-  | fname ->
-    let ic = open_in fname in
-    from_ic_close_at_end (From_file (fname, ic)) ic
-;;
-
-let open_in_bin fname =
-  match fname with
-  | "-" -> stdin
-  | fname ->
-    let ic = open_in_bin fname in
-    from_ic_close_at_end (From_file (fname, ic)) ic
-;;
-
-let from_file = open_in;;
-let from_file_bin = open_in_bin;;
-
-let memo_from_ic =
-  let memo = ref [] in
-  (fun scan_close_ic ic ->
-   try List.assq ic !memo with
-   | Not_found ->
-     let ib = from_ic scan_close_ic (From_channel ic) ic in
-     memo := (ic, ib) :: !memo;
-     ib)
-;;
-
-let from_channel = memo_from_ic scan_raise_at_end;;
-
-let close_in ib =
-  match ib.input_name with
-  | From_file (_fname, ic) -> Pervasives.close_in ic
-  | From_string | From_function -> ()
-  | From_channel ic -> Pervasives.close_in ic
-;;
+  ;;
+
+  let end_of_input ib =
+    ignore (peek_char ib);
+    ib.eof
+  ;;
+
+  let eof ib = ib.eof;;
+
+  let beginning_of_input ib = ib.char_count = 0;;
+  let name_of_input ib =
+    match ib.input_name with
+    | From_file (fname, _ic) -> fname
+    | From_string -> "unnamed character string"
+    | From_function -> "unnamed function"
+    | From_channel _ic -> "unnamed pervasives input channel"
+  ;;
+
+  let char_count ib =
+    if ib.current_char_is_valid then ib.char_count - 1 else ib.char_count
+  ;;
+  let line_count ib = ib.line_count;;
+  let reset_token ib = Buffer.reset ib.tokbuf;;
+  let invalidate_current_char ib = ib.current_char_is_valid <- false;;
+
+  let token ib =
+    let tokbuf = ib.tokbuf in
+    let tok = Buffer.contents tokbuf in
+    Buffer.clear tokbuf;
+    ib.token_count <- succ ib.token_count;
+    tok
+  ;;
+
+  let token_count ib = ib.token_count;;
+
+  let skip_char max ib =
+    invalidate_current_char ib;
+    max
+  ;;
+
+  let ignore_char max ib = skip_char (max - 1) ib;;
+
+  let store_char max ib c =
+    Buffer.add_char ib.tokbuf c;
+    ignore_char max ib
+  ;;
+
+  let default_token_buffer_size = 1024;;
+
+  let create iname next = {
+    eof = false;
+    current_char = null_char;
+    current_char_is_valid = false;
+    char_count = 0;
+    line_count = 0;
+    token_count = 0;
+    get_next_char = next;
+    tokbuf = Buffer.create default_token_buffer_size;
+    input_name = iname;
+  }
+  ;;
+
+  let from_string s =
+    let i = ref 0 in
+    let len = String.length s in
+    let next () =
+      if !i >= len then raise End_of_file else
+      let c = s.[!i] in
+      incr i;
+      c in
+    create From_string next
+  ;;
+
+  let from_function = create From_function;;
+
+  (* Scanning from an input channel. *)
+
+  (* Position of the problem:
+
+     We cannot prevent the scanning mechanism to use one lookahead character,
+     if needed by the semantics of the format string specifications (e.g. a
+     trailing ``skip space'' specification in the format string); in this case,
+     the mandatory lookahead character is indeed read from the input and not
+     used to return the token read. It is thus mandatory to be able to store
+     an unused lookahead character somewhere to get it as the first character
+     of the next scan.
+
+     To circumvent this problem, all the scanning functions get a low level
+     input buffer argument where they store the lookahead character when
+     needed; additionally, the input buffer is the only source of character of
+     a scanner. The [scanbuf] input buffers are defined in module {!Scanning}.
+
+     Now we understand that it is extremely important that related successive
+     calls to scanners indeed read from the same input buffer. In effect, if a
+     scanner [scan1] is reading from [ib1] and stores an unused lookahead
+     character [c1] into its input buffer [ib1], then another scanner [scan2]
+     not reading from the same buffer [ib1] will miss the character [c],
+     seemingly vanished in the air from the point of view of [scan2].
+
+     This mechanism works perfectly to read from strings, from files, and from
+     functions, since in those cases, allocating two buffers reading from the
+     same source is unnatural.
+
+     Still, there is a difficulty in the case of scanning from an input
+     channel. In effect, when scanning from an input channel [ic], this channel
+     may not have been allocated from within this library. Hence, it may be
+     shared (two functions of the user's program may successively read from
+     [ic]). This is highly error prone since, one of the function may seek the
+     input channel, while the other function has still an unused lookahead
+     character in its input buffer. In conclusion, you should never mix direct
+     low level reading and high level scanning from the same input channel.
+
+     This phenomenon of reading mess is even worse when one defines more than
+     one scanning buffer reading from the same input channel
+     [ic]. Unfortunately, we have no simple way to get rid of this problem
+     (unless the basic input channel API is modified to offer a ``consider this
+     char as unread'' procedure to keep back the unused lookahead character as
+     available in the input channel for further reading).
+
+     To prevent some of the confusion the scanning buffer allocation function
+     is a memo function that never allocates two different scanning buffers for
+     the same input channel. This way, the user can naively perform successive
+     call to [fscanf] below, without allocating a new scanning buffer at each
+     invocation and hence preserving the expected semantics.
+
+     As mentioned above, a more ambitious fix could be to change the input
+     channel API to allow arbitrary mixing of direct and formatted reading from
+     input channels. *)
+
+  (* Perform bufferized input to improve efficiency. *)
+  let file_buffer_size = ref 1024;;
+
+  (* The scanner closes the input channel at end of input. *)
+  let scan_close_at_end ic = close_in ic; raise End_of_file;;
+
+  (* The scanner does not close the input channel at end of input:
+     it just raises [End_of_file]. *)
+  let scan_raise_at_end _ic = raise End_of_file;;
+
+  let from_ic scan_close_ic iname ic =
+    let len = !file_buffer_size in
+    let buf = String.create len in
+    let i = ref 0 in
+    let lim = ref 0 in
+    let eof = ref false in
+    let next () =
+      if !i < !lim then begin let c = buf.[!i] in incr i; c end else
+      if !eof then raise End_of_file else begin
+        lim := input ic buf 0 len;
+        if !lim = 0 then begin eof := true; scan_close_ic ic end else begin
+          i := 1;
+          buf.[0]
+        end
+      end in
+    create iname next
+  ;;
+
+  let from_ic_close_at_end = from_ic scan_close_at_end;;
+
+  (* The scanning buffer reading from [Pervasives.stdin].
+     One could try to define [stdib] as a scanning buffer reading a character at a
+     time (no bufferization at all), but unfortunately the top-level
+     interaction would be wrong.
+     This is due to some kind of ``race condition'' when reading from [Pervasives.stdin],
+     since the interactive compiler and [scanf] will simultaneously read the
+     material they need from [Pervasives.stdin]; then, confusion will result from what should
+     be read by the top-level and what should be read by [scanf].
+     This is even more complicated by the one character lookahead that [scanf]
+     is sometimes obliged to maintain: the lookahead character will be available
+     for the next ([scanf]) entry, seemingly coming from nowhere.
+     Also no [End_of_file] is raised when reading from stdin: if not enough
+     characters have been read, we simply ask to read more. *)
+  let stdin =
+    from_ic scan_raise_at_end
+      (From_file ("-", Pervasives.stdin)) Pervasives.stdin
+  ;;
+
+  let stdib = stdin;;
+
+  let open_in fname =
+    match fname with
+    | "-" -> stdin
+    | fname ->
+      let ic = open_in fname in
+      from_ic_close_at_end (From_file (fname, ic)) ic
+  ;;
+
+  let open_in_bin fname =
+    match fname with
+    | "-" -> stdin
+    | fname ->
+      let ic = open_in_bin fname in
+      from_ic_close_at_end (From_file (fname, ic)) ic
+  ;;
+
+  let from_file = open_in;;
+  let from_file_bin = open_in_bin;;
+
+  let memo_from_ic =
+    let memo = ref [] in
+    (fun scan_close_ic ic ->
+     try List.assq ic !memo with
+     | Not_found ->
+       let ib = from_ic scan_close_ic (From_channel ic) ic in
+       memo := (ic, ib) :: !memo;
+       ib)
+  ;;
+
+  let from_channel = memo_from_ic scan_raise_at_end;;
+
+  let close_in ib =
+    match ib.input_name with
+    | From_file (_fname, ic) -> Pervasives.close_in ic
+    | From_string | From_function -> ()
+    | From_channel ic -> Pervasives.close_in ic
+  ;;
 
 end
 ;;
@@ -409,19 +409,47 @@ external string_to_format :
 exception Scan_failure of string;;
 
 let bad_input s = raise (Scan_failure s);;
-let bad_input_char c = bad_input (String.make 1 c);;
 
 let bad_input_escape c =
   bad_input (Printf.sprintf "illegal escape character %C" c)
 ;;
 
+let bad_token_length message =
+  bad_input
+    (Printf.sprintf
+       "scanning of %s failed: \
+        the specified length was too short for token" message)
+;;
+
+let bad_end_of_input message =
+  bad_input
+    (Printf.sprintf
+       "scanning of %s failed: \
+        premature end of file occurred before end of token" message)
+;;
+
+let int_max = function
+  | None -> max_int
+  | Some max -> max
+;;
+
+let int_min = function
+  | None -> 0
+  | Some max -> max
+;;
+
+let float_min = function
+  | None -> max_int
+  | Some min -> min
+;;
+
 module Sformat = Printf.CamlinternalPr.Sformat;;
 module Tformat = Printf.CamlinternalPr.Tformat;;
 
 let bad_conversion fmt i c =
   invalid_arg
     (Printf.sprintf
-       "scanf: bad conversion %%%c, at char number %i \
+       "scanf: bad conversion %%%C, at char number %i \
         in format string ``%s''" c i (Sformat.to_string fmt))
 ;;
 
@@ -458,11 +486,17 @@ let compatible_format_type fmt1 fmt2 =
 (* Checking that [c] is indeed in the input, then skips it.
    In this case, the character c has been explicitely specified in the
    format as being mandatory in the input; hence we should fail with
-   End_of_file in case of end_of_input.
-   That's why we use checked_peek_char here.
+   End_of_file in case of end_of_input. (Remember that Scan_failure is raised
+   only when (we can prove by evidence) that the input does not match the
+   format string given. We must thus differentiate End_of_file as an error
+   due to lack of input, and Scan_failure which is due to provably wrong
+   input. I am not sure this is worth to burden: it is complex and somehow
+   subliminal; should be clearer to fail with Scan_failure "Not enough input
+   to complete scanning"!)
+
+   That's why, waiting for a better solution, we use checked_peek_char here.
    We are also careful to treat "\r\n" in the input as a end of line marker: it
-   always matches a '\n' specification in the input format string.
- *)
+   always matches a '\n' specification in the input format string. *)
 let rec check_char ib c =
   let ci = Scanning.checked_peek_char ib in
   if ci = c then Scanning.invalidate_current_char ib else begin
@@ -497,7 +531,8 @@ let token_bool ib =
   match Scanning.token ib with
   | "true" -> true
   | "false" -> false
-  | s -> bad_input ("invalid boolean " ^ s);;
+  | s -> bad_input (Printf.sprintf "invalid boolean %S" s)
+;;
 
 (* Extract an integer literal token.
    Since the functions Pervasives.*int*_of_string do not accept a leading +,
@@ -543,14 +578,15 @@ let token_int64 conv ib = int64_of_string (token_int_literal conv ib);;
 
 (* Scanning numbers. *)
 
-(* Digits scanning functions suppose that one character has been
-   checked and is available, since they return at end of file with the
-   currently found token selected. The digits scanning functions scan
-   a possibly empty sequence of digits, (hence a successful scanning
-   from one of those functions does not imply that the token is a
-   well-formed number: to get a true number, it is mandatory to check
-   that at least one digit is available before calling a digit
-   scanning function). *)
+(* Digits scanning functions suppose that one character has been checked and
+   is available, since they return at end of file with the currently found
+   token selected.
+
+   Put it in another way, the digits scanning functions scan for a possibly
+   empty sequence of digits, (hence, a successful scanning from one of those
+   functions does not imply that the token is a well-formed number: to get a
+   true number, it is mandatory to check that at least one valid digit is
+   available before calling one of the digit scanning functions). *)
 
 (* The decimal case is treated especially for optimization purposes. *)
 let rec scan_decimal_digits max ib =
@@ -568,12 +604,14 @@ let rec scan_decimal_digits max ib =
 ;;
 
 let scan_decimal_digits_plus max ib =
+  if max = 0 then bad_token_length "decimal digits" else
   let c = Scanning.checked_peek_char ib in
   match c with
   | '0' .. '9' ->
     let max = Scanning.store_char max ib c in
     scan_decimal_digits max ib
-  | c -> bad_input_char c
+  | c ->
+    bad_input (Printf.sprintf "character %C is not a decimal digit" c)
 ;;
 
 let scan_digits_plus digitp max ib =
@@ -592,11 +630,16 @@ let scan_digits_plus digitp max ib =
       scan_digits max
     | _ -> max in
 
+  (* Ensure we have got enough width left,
+     and read at list one digit. *)
+  if max = 0 then bad_token_length "digits" else
   let c = Scanning.checked_peek_char ib in
+
   if digitp c then
     let max = Scanning.store_char max ib c in
     scan_digits max
-  else bad_input_char c
+  else
+    bad_input (Printf.sprintf "character %C is not a digit" c)
 ;;
 
 let is_binary_digit = function
@@ -660,7 +703,7 @@ let scan_optionally_signed_int max ib =
   scan_unsigned_int max ib
 ;;
 
-let scan_int_conv conv max ib =
+let scan_int_conv conv max _min ib =
   match conv with
   | 'b' -> scan_binary_int max ib
   | 'd' -> scan_optionally_signed_decimal_int max ib
@@ -703,20 +746,51 @@ let scan_int_part max ib =
   scan_decimal_digits max ib
 ;;
 
-let scan_float max ib =
+(*
+    For the time being we have (as found in scanf.mli):
+    The field width is composed of an optional integer literal
+    indicating the maximal width of the token to read.
+    Unfortunately, the type-checker let the user write an optional precision,
+    since this is valid for printf format strings.
+
+   Thus, the next step for Scanf is to support a full width indication, more
+   or less similar to the one for printf, possibly extended to the
+   specification of a [max, min] range for the width of the token read for
+   strings. Something like the following spec for scanf.mli:
+
+   The optional [width] is an integer indicating the maximal
+   width of the token read. For instance, [%6d] reads an integer,
+   having at most 6 characters.
+
+   The optional [precision] is a dot [.] followed by an integer:
+   - in the floating point number conversions ([%f], [%e], [%g], [%F], [%E], and
+   [%F] conversions, the [precision] indicates the maximum number of digits
+   that may follow the decimal point. For instance, [%.4f] reads a [float]
+   with at most 4 fractional digits,
+   - in the string conversions ([%s], [%S], [%\[ range \]]), and in the
+   integer number conversions ([%i], [%d], [%u], [%x], [%o], and their
+   [int32], [int64], and [native_int] correspondent), the
+   [precision] indicates the required minimum width of the token read,
+   - on all other conversions, the width and precision are meaningless and
+   ignored (FIXME: lead to a runtime error ? type checking error ?).
+
+*)
+let scan_float max max_frac_part ib =
   let max = scan_int_part max ib in
-  if max = 0 then max else
+  if max = 0 then max, max_frac_part else
   let c = Scanning.peek_char ib in
-  if Scanning.eof ib then max else
+  if Scanning.eof ib then max, max_frac_part else
   match c with
   | '.' ->
     let max = Scanning.store_char max ib c in
-    let max = scan_frac_part max ib in
-    scan_exp_part max ib
-  | c -> scan_exp_part max ib
+    let max_precision = min max max_frac_part in
+    let max = max - (max_precision - scan_frac_part max_precision ib) in
+    scan_exp_part max ib, max_frac_part
+  | c ->
+    scan_exp_part max ib, max_frac_part
 ;;
 
-let scan_Float max ib =
+let scan_Float max max_frac_part ib =
   let max = scan_optionally_signed_decimal_int max ib in
   if max = 0 then bad_float () else
   let c = Scanning.peek_char ib in
@@ -724,6 +798,8 @@ let scan_Float max ib =
   match c with
   | '.' ->
     let max = Scanning.store_char max ib c in
+    let max_precision = min max max_frac_part in
+    let max = max - (max_precision - scan_frac_part max_precision ib) in
     let max = scan_frac_part max ib in
     scan_exp_part max ib
   | 'e' | 'E' ->
@@ -753,6 +829,9 @@ let scan_string stp max ib =
 
 (* Scan a char: peek strictly one character in the input, whatsoever. *)
 let scan_char max ib =
+  (* The case max = 0 could not happen here, since it is tested before
+     calling scan_char, in the main scanning function.
+    if max = 0 then bad_token_length "a character" else *)
   Scanning.store_char max ib (Scanning.checked_peek_char ib)
 ;;
 
@@ -773,9 +852,11 @@ let char_for_decimal_code c0 c1 c2 =
     100 * decimal_value_of_char c0 +
      10 * decimal_value_of_char c1 +
           decimal_value_of_char c2 in
-  if c < 0 || c > 255
-  then bad_input (Printf.sprintf "bad char \\%c%c%c" c0 c1 c2)
-  else char_of_int c
+  if c < 0 || c > 255 then
+    bad_input
+      (Printf.sprintf
+         "bad character decimal encoding \\%c%c%c" c0 c1 c2) else
+  char_of_int c
 ;;
 
 (* The integer value corresponding to the facial value of a valid
@@ -798,21 +879,23 @@ let char_for_hexadecimal_code c1 c2 =
   let c =
     16 * hexadecimal_value_of_char c1 +
          hexadecimal_value_of_char c2 in
-  if c < 0 || c > 255
-  then bad_input (Printf.sprintf "bad char \\%c%c" c1 c2)
-  else char_of_int c
+  if c < 0 || c > 255 then
+    bad_input
+      (Printf.sprintf "bad character hexadecimal encoding \\%c%c" c1 c2) else
+  char_of_int c
 ;;
 
-(* Called when encountering '\\' as starter of a char.
+(* Called in particular when encountering '\\' as starter of a char.
    Stops before the corresponding '\''. *)
 let check_next_char message max ib =
-  if max = 0 then bad_input message else
+  if max = 0 then bad_token_length message else
   let c = Scanning.peek_char ib in
-  if Scanning.eof ib then bad_input message else c
+  if Scanning.eof ib then bad_end_of_input message else
+  c
 ;;
 
-let check_next_char_for_char = check_next_char "a char";;
-let check_next_char_for_string = check_next_char "a string";;
+let check_next_char_for_char = check_next_char "a Char";;
+let check_next_char_for_string = check_next_char "a String";;
 
 let scan_backslash_char max ib =
   match check_next_char_for_char max ib with
@@ -837,14 +920,15 @@ let scan_backslash_char max ib =
     let c1 = get_digit () in
     let c2 = get_digit () in
     Scanning.store_char (max - 2) ib (char_for_hexadecimal_code c1 c2)
-  | c -> bad_input_char c
+  | c ->
+    bad_input_escape c
 ;;
 
 (* Scan a character (a Caml token). *)
 let scan_Char max ib =
 
   let rec find_start max =
-    match check_next_char_for_char max ib with
+    match Scanning.checked_peek_char ib with
     | '\'' -> find_char (Scanning.ignore_char max ib)
     | c -> character_mismatch '\'' c
 
@@ -865,7 +949,7 @@ let scan_Char max ib =
 let scan_String max ib =
 
   let rec find_start max =
-    match check_next_char_for_string max ib with
+    match Scanning.checked_peek_char ib with
     | '\"' -> find_stop (Scanning.ignore_char max ib)
     | c -> character_mismatch '\"' c
 
@@ -896,14 +980,15 @@ let scan_String max ib =
 
 (* Scan a boolean (a Caml token). *)
 let scan_bool max ib =
-  if max < 4 then bad_input "a boolean" else
+  if max < 4 then bad_token_length "a boolean" else
   let c = Scanning.checked_peek_char ib in
-  if Scanning.eof ib then bad_input "a boolean" else
   let m =
     match c with
     | 't' -> 4
     | 'f' -> 5
-    | _ -> bad_input "a boolean" in
+    | c ->
+      bad_input
+        (Printf.sprintf "the character %C cannot start a boolean" c) in
   scan_string [] (min max m) ib
 ;;
 
@@ -1154,6 +1239,14 @@ let rec skip_whites ib =
   end
 ;;
 
+(* The global error report function for [Scanf]. *)
+let scanf_bad_input ib = function
+  | Scan_failure s | Failure s ->
+    let i = Scanning.char_count ib in
+    bad_input (Printf.sprintf "scanf: bad input at char number %i: ``%s''" i s)
+  | x -> raise x
+;;
+
 let list_iter_i f l =
   let rec loop i = function
   | [] -> ()
@@ -1162,34 +1255,26 @@ let list_iter_i f l =
   loop 0 l
 ;;
 
-(* The global error report function for [Scanf]. *)
-let scanf_bad_input ib = function
-  | Scan_failure s | Failure s ->
-    let i = Scanning.char_count ib in
-    bad_input (Printf.sprintf "scanf: bad input at char number %i: %s" i s)
-  | x -> raise x
-;;
-
 let ascanf sc fmt =
   let ac = Tformat.ac_of_format fmt in
-    match ac.Tformat.ac_rdrs with
-    | 0 ->
-      Obj.magic (fun f -> sc fmt [||] f)
-    | 1 ->
-      Obj.magic (fun x f -> sc fmt [| Obj.repr x |] f)
-    | 2 ->
-      Obj.magic (fun x y f -> sc fmt [| Obj.repr x; Obj.repr y; |] f)
-    | 3 ->
-      Obj.magic
-        (fun x y z f -> sc fmt [| Obj.repr x; Obj.repr y; Obj.repr z; |] f)
-    | nargs ->
-      let rec loop i args =
-        if i >= nargs then
-          let a = Array.make nargs (Obj.repr 0) in
-          list_iter_i (fun i arg -> a.(nargs - i - 1) <- arg) args;
-          Obj.magic (fun f -> sc fmt a f)
-        else Obj.magic (fun x -> loop (succ i) (x :: args)) in
-      loop 0 []
+  match ac.Tformat.ac_rdrs with
+  | 0 ->
+    Obj.magic (fun f -> sc fmt [||] f)
+  | 1 ->
+    Obj.magic (fun x f -> sc fmt [| Obj.repr x |] f)
+  | 2 ->
+    Obj.magic (fun x y f -> sc fmt [| Obj.repr x; Obj.repr y; |] f)
+  | 3 ->
+    Obj.magic
+      (fun x y z f -> sc fmt [| Obj.repr x; Obj.repr y; Obj.repr z; |] f)
+  | nargs ->
+    let rec loop i args =
+      if i >= nargs then
+        let a = Array.make nargs (Obj.repr 0) in
+        list_iter_i (fun i arg -> a.(nargs - i - 1) <- arg) args;
+        Obj.magic (fun f -> sc fmt a f)
+      else Obj.magic (fun x -> loop (succ i) (x :: args)) in
+    loop 0 []
 ;;
 
 (* The [scan_format] main scanning function.
@@ -1215,8 +1300,6 @@ let ascanf sc fmt =
 
 let scan_format ib ef fmt rv f =
 
-  let lim = Sformat.length fmt - 1 in
-
   let limr = Array.length rv - 1 in
 
   let return v = Obj.magic v () in
@@ -1226,13 +1309,13 @@ let scan_format ib ef fmt rv f =
 
   let rec scan fmt =
 
+    let lim = Sformat.length fmt - 1 in
+
     let rec scan_fmt ir f i =
       if i > lim then ir, f else
       match Sformat.get fmt i with
       | ' ' -> skip_whites ib; scan_fmt ir f (succ i)
-      | '%' ->
-        if i > lim then incomplete_format fmt else
-        scan_conversion false max_int ir f (succ i)
+      | '%' -> scan_skip ir f (succ i)
       | '@' ->
         let i = succ i in
         if i > lim then incomplete_format fmt else begin
@@ -1240,8 +1323,43 @@ let scan_format ib ef fmt rv f =
         scan_fmt ir f (succ i) end
       | c -> check_char ib c; scan_fmt ir f (succ i)
 
-    and scan_conversion skip max ir f i =
+    and scan_skip ir f i =
+      if i > lim then ir, f else
+      match Sformat.get fmt i with
+      | '_' -> scan_limits true ir f (succ i)
+      | _ -> scan_limits false ir f i
+
+    and scan_limits skip ir f i =
+      if i > lim then ir, f else
+      let max_opt, min_opt, i =
+        match Sformat.get fmt i with
+        | '0' .. '9' as conv ->
+          let rec read_width accu i =
+            if i > lim then accu, i else
+            match Sformat.get fmt i with
+            | '0' .. '9' as c ->
+              let accu = 10 * accu + decimal_value_of_char c in
+              read_width accu (succ i)
+            | _ -> accu, i in
+
+          let max, i = read_width (decimal_value_of_char conv) (succ i) in
+
+          if i > lim then incomplete_format fmt else
+          begin
+            match Sformat.get fmt i with
+            | '.' ->
+              let min, i = read_width 0 (succ i) in
+              (Some max, Some min, i)
+            | _ -> Some max, None, i
+          end
+        | _ -> None, None, i in
+
+      scan_conversion skip max_opt min_opt ir f i
+
+    and scan_conversion skip max_opt min_opt ir f i =
       let stack = if skip then no_stack else stack in
+      let max = int_max max_opt in
+      let min = int_min min_opt in
       match Sformat.get fmt i with
       | '%' as conv ->
         check_char ib conv; scan_fmt ir f (succ i)
@@ -1257,25 +1375,31 @@ let scan_format ib ef fmt rv f =
         let i, stp = scan_fmt_stoppers (succ i) in
         let _x = scan_chars_in_char_set stp char_set max ib in
         scan_fmt ir (stack f (token_string ib)) (succ i)
-      | 'c' when max = 0 ->
+      | ('c' | 'C') when max = 0 ->
         let c = Scanning.checked_peek_char ib in
         scan_fmt ir (stack f c) (succ i)
-      | 'c' | 'C' as conv ->
-        if max <> 1 && max <> max_int then bad_conversion fmt i conv else
-        let _x =
-          if conv = 'c' then scan_char max ib else scan_Char max ib in
+      | 'c' ->
+        let _x = scan_char max ib in
+        scan_fmt ir (stack f (token_char ib)) (succ i)
+      | 'C' ->
+        let _x = scan_Char max ib in
         scan_fmt ir (stack f (token_char ib)) (succ i)
       | 'd' | 'i' | 'o' | 'u' | 'x' | 'X' as conv ->
-        let _x = scan_int_conv conv max ib in
+        let _x = scan_int_conv conv max min ib in
         scan_fmt ir (stack f (token_int conv ib)) (succ i)
       | 'N' as conv ->
         scan_fmt ir (stack f (get_count conv ib)) (succ i)
       | 'f' | 'e' | 'E' | 'g' | 'G' ->
-        let _x = scan_float max ib in
+        let min = float_min min_opt in
+        let _x = scan_float max min ib in
         scan_fmt ir (stack f (token_float ib)) (succ i)
       | 'F' ->
-        let _x = scan_Float max ib in
+        let min = float_min min_opt in
+        let _x = scan_Float max min ib in
         scan_fmt ir (stack f (token_float ib)) (succ i)
+(*      | 'B' | 'b' when max = Some 0 ->
+        let _x = scan_bool max ib in
+        scan_fmt ir (stack f (token_int ib)) (succ i) *)
       | 'B' | 'b' ->
         let _x = scan_bool max ib in
         scan_fmt ir (stack f (token_bool ib)) (succ i)
@@ -1289,7 +1413,7 @@ let scan_format ib ef fmt rv f =
         match Sformat.get fmt i with
         (* This is in fact an integer conversion (e.g. %ld, %ni, or %Lo). *)
         | 'd' | 'i' | 'o' | 'u' | 'x' | 'X' as conv1 ->
-          let _x = scan_int_conv conv1 max ib in
+          let _x = scan_int_conv conv1 max min ib in
           (* Look back to the character that triggered the integer conversion
              (this character is either 'l', 'n' or 'L') to find the
              conversion to apply to the integer token read. *)
@@ -1304,24 +1428,6 @@ let scan_format ib ef fmt rv f =
         else bad_input "end of input not found"
       | ',' ->
         scan_fmt ir f (succ i)
-      | '_' ->
-        if i > lim then incomplete_format fmt else
-        scan_conversion true max ir f (succ i)
-      | '0' .. '9' as conv ->
-        let rec read_width accu i =
-          if i > lim then accu, i else
-          match Sformat.get fmt i with
-          | '0' .. '9' as c ->
-            let accu = 10 * accu + decimal_value_of_char c in
-            read_width accu (succ i)
-          | _ -> accu, i in
-        let max, i = read_width (decimal_value_of_char conv) (succ i) in
-        if i > lim then incomplete_format fmt else begin
-        match Sformat.get fmt i with
-        | '.' ->
-          let p, i = read_width 0 (succ i) in
-          scan_conversion skip (succ (max + p)) ir f i
-        | _ -> scan_conversion skip max ir f i end
       | '(' | '{' as conv (* ')' '}' *) ->
         let i = succ i in
         (* Find the static specification for the format to read. *)
@@ -1338,7 +1444,7 @@ let scan_format ib ef fmt rv f =
            read. *)
         if conv = '{' (* '}' *) then scan_fmt ir (stack f rf) j else
         (* Or else, read according to the format string just read. *)
-        let ir, nf = scan (Obj.magic rf) ir (stack f rf) 0 in
+        let ir, nf = scan (string_to_format rf) ir (stack f rf) 0 in
         (* Return the format string read and the value just read,
            then go on with the rest of the format. *)
         scan_fmt ir nf j
index 315ea166b18399e3f42a8d993c06c052ce6980a8..dae3000c737a29e2838b838877af41e9e902ed70 100644 (file)
@@ -119,6 +119,10 @@ val open_in : string -> in_channel;;
 val open_in_bin : string -> in_channel;;
 (** Bufferized file reading in binary mode. *)
 
+val close_in : in_channel -> unit;;
+(** Close the [Pervasives.input_channel] associated with the given
+  [Scanning.in_channel]. *)
+
 val from_file : string -> in_channel;;
 (** An alias for [open_in] above. *)
 val from_file_bin : string -> in_channel;;
@@ -241,11 +245,12 @@ val bscanf : Scanning.in_channel -> ('a, 'b, 'c, 'd) scanner;;
 
     - [d]: reads an optionally signed decimal integer.
     - [i]: reads an optionally signed integer
-      (usual input formats for hexadecimal ([0x[d]+] and [0X[d]+]),
-       octal ([0o[d]+]), and binary [0b[d]+] notations are understood).
+      (usual input conventions for decimal ([0-9]+), hexadecimal
+       ([0x[0-9a-f]+] and [0X[0-9A-F]+]), octal ([0o[0-7]+]), and binary
+       ([0b[0-1]+]) notations are understood).
     - [u]: reads an unsigned decimal integer.
-    - [x] or [X]: reads an unsigned hexadecimal integer.
-    - [o]: reads an unsigned octal integer.
+    - [x] or [X]: reads an unsigned hexadecimal integer ([[0-9a-f]+] or [[0-9A-F]+]).
+    - [o]: reads an unsigned octal integer ([[0-7]+]).
     - [s]: reads a string argument that spreads as much as possible, until the
       following bounding condition holds:
       - a whitespace has been found (see {!Scanf.space}),
@@ -272,11 +277,11 @@ val bscanf : Scanning.in_channel -> ('a, 'b, 'c, 'd) scanner;;
     - [b]: reads a boolean argument (for backward compatibility; do not use
       in new programs).
     - [ld], [li], [lu], [lx], [lX], [lo]: reads an [int32] argument to
-      the format specified by the second letter (decimal, hexadecimal, etc).
+      the format specified by the second letter for regular integers.
     - [nd], [ni], [nu], [nx], [nX], [no]: reads a [nativeint] argument to
-      the format specified by the second letter.
+      the format specified by the second letter for regular integers.
     - [Ld], [Li], [Lu], [Lx], [LX], [Lo]: reads an [int64] argument to
-      the format specified by the second letter.
+      the format specified by the second letter for regular integers.
     - [\[ range \]]: reads characters that matches one of the characters
       mentioned in the range of characters [range] (or not mentioned in
       it, if the range starts with [^]). Reads a [string] that can be
@@ -296,16 +301,24 @@ val bscanf : Scanning.in_channel -> ('a, 'b, 'c, 'd) scanner;;
     - [\{ fmt %\}]: reads a format string argument.
       The format string read must have the same type as the format string
       specification [fmt].
-      For instance, ["%\{%i%\}"] reads any format string that can read a value of
-      type [int]; hence [Scanf.sscanf "fmt:\\\"number is %u\\\"" "fmt:%\{%i%\}"]
+      For instance, ["%{ %i %}"] reads any format string that can read a value of
+      type [int]; hence [Scanf.sscanf "fmt:\"number is %u\"" "fmt:%{%i%}"]
       succeeds and returns the format string ["number is %u"].
     - [\( fmt %\)]: scanning format substitution.
-      Reads a format string to replace [fmt].
+      Reads a format string to read with it instead of [fmt].
       The format string read must have the same type as the format string
-      specification [fmt].
-      For instance, ["%\( %i% \)"] reads any format string that can read a value
-      of type [int]; hence [Scanf.sscanf "\\\"%4d\\\"1234.00" "%\(%i%\)"]
-      is equivalent to [Scanf.sscanf "1234.00" "%4d"].
+      specification [fmt] that is replaces.
+      For instance, ["%( %i %)"] reads any format string that can read a value
+      of type [int].
+      Returns the format string read, and the value read using the format
+      string read.
+      Hence, [Scanf.sscanf "\"%4d\"1234.00" "%(%i%)"
+                (fun fmt i -> fmt, i)] evaluates to [("%4d", 1234)].
+      If the special flag [_] is used, the conversion discards the
+      format string read and only returns the value read with the format
+      string read.
+      Hence, [Scanf.sscanf "\"%4d\"1234.00" "%_(%i%)"] is simply
+      equivalent to [Scanf.sscanf "1234.00" "%4d"].
     - [l]: returns the number of lines read so far.
     - [n]: returns the number of characters read so far.
     - [N] or [L]: returns the number of tokens read so far.
@@ -329,7 +342,7 @@ val bscanf : Scanning.in_channel -> ('a, 'b, 'c, 'd) scanner;;
     Notes:
 
     - as mentioned above, a [%s] conversion always succeeds, even if there is
-      nothing to read in the input: it simply returns [""].
+      nothing to read in the input: in this case, it simply returns [""].
 
     - in addition to the relevant digits, ['_'] characters may appear
     inside numbers (this is reminiscent to the usual Caml lexical
index a9e4b6c66f7dc98f3aea715325a2f1b14a0500b5..10425ca5f44c09f1fb4fee0e5d20645fc6249beb 100644 (file)
@@ -1,6 +1,7 @@
 # $Id$
 
 BASEDIR=${PWD}
+NO_PRINT=`($(MAKE) empty --no-print-directory > /dev/null 2>&1) && echo '--no-print-directory' || echo ''`
 
 default:
        @echo "Available targets:"
@@ -13,7 +14,7 @@ default:
 
 all:
        @for dir in tests/*; do \
-         $(MAKE) one DIR=$$dir; \
+         $(MAKE) $(NO_PRINT) one DIR=$$dir; \
        done 2>&1 | tee _log
        @$(MAKE) report
 
@@ -21,7 +22,7 @@ list:
        @if [ -z $(FILE) ]; then echo "No value set for variable 'FILE'."; exit 1; fi
        @if [ ! -f $(FILE) ]; then echo "File '$(FILE)' does not exist."; exit 1; fi
        @while read LINE; do \
-         $(MAKE) one DIR=$$LINE; \
+         $(MAKE) $(NO_PRINT) one DIR=$$LINE; \
        done < $(FILE) 2>&1 | tee _log
        @$(MAKE) report
 
@@ -56,4 +57,6 @@ report: FORCE
        @echo '  ' `grep '^Error' _log | wc -l` 'compilation error(s)'
        @echo '  ' `grep '^Warning' _log | wc -l` 'compilation warning(s)'
 
+empty: FORCE
+
 FORCE:
index 354953bfcccad33b6565ca5c893de5356e2c0304..6ede5e50bf80c77c7fab18150e9299106175baa4 100644 (file)
@@ -1,6 +1,6 @@
-MODULES=
+#MODULES=
 MAIN_MODULE=graph_test
-ADD_COMPFLAGS=
+#ADD_COMPFLAGS=
 LIBRARIES=graphics
 
 include ../../makefiles/Makefile.one
index 295f47895cb72dfc108f43e7aa43f17a494b7896..a37aa33d61171a5fd74ced77f7db6d99f063c426 100644 (file)
@@ -1,4 +1,4 @@
-MODULES=
+#MODULES=
 MAIN_MODULE=sorts
 ADD_COMPFLAGS=-thread
 LIBRARIES=unix threads graphics
index de2c9e86566408c92d6b257102385a113a7666c1..be82565857d0f18c3c2bcb8e50909555cf6e0834 100644 (file)
@@ -1,6 +1,6 @@
-MODULES=
+#MODULES=
 MAIN_MODULE=graph_example
-ADD_COMPFLAGS=
+#ADD_COMPFLAGS=
 LIBRARIES=graphics
 
 include ../../makefiles/Makefile.one
index 1ee9bc8eb5fae0605d0de1acba8fd8592c7163d9..a1abd1aab8e4d28e82dc0a3825a0d0b11759691a 100644 (file)
@@ -15,9 +15,9 @@ OCAMLMKLIB=$(OCAMLRUN) $(TOPDIR)/tools/ocamlmklib$(EXE)
 OCAMLYACC=$(TOPDIR)/yacc/ocamlyacc$(EXE)
 OCAMLBUILD=$(TOPDIR)/_build/ocamlbuild/ocamlbuild.native
 DUMPOBJ=$(OCAMLRUN) $(TOPDIR)/tool/dumpobj$(EXE)
-COMPFLAGS=
-FORTRAN_COMPILER=/sw/bin/gcc
-FORTRAN_LIBRARY=/sw/lib/gcc4.3/lib/libgfortran.a
+#COMPFLAGS=
+#FORTRAN_COMPILER=
+#FORTRAN_LIBRARY=
 
 defaultclean:
        @rm -f *.cmo *.cmi *.cmx *.cma *.cmxa *.cmxs *.$(O) *.$(SO) *.$(A)
index 081b36916b50c2b61b8fba11dc99da8fb2365545..4921d7df10c46972996406542d3f5415efed894b 100644 (file)
@@ -1,18 +1,22 @@
 # $Id$
 
-CMI_FILES=$(patsubst %,%.cmi,$(MODULES))
-CMO_FILES=$(patsubst %,%.cmo,$(MODULES))
-CMX_FILES=$(patsubst %,%.cmx,$(MODULES))
-CMA_FILES=$(patsubst %,%.cma,$(LIBRARIES))
-CMXA_FILES=$(patsubst %,%.cmxa,$(LIBRARIES))
-ML_FILES=$(patsubst %,%.ml,$(LEX_MODULES) $(YACC_MODULES))
-O_FILES=$(patsubst %,%.$(O),$(C_FILES))
+CMI_FILES=$(MODULES:=.cmi)
+CMO_FILES=$(MODULES:=.cmo)
+CMX_FILES=$(MODULES:=.cmx)
+CMA_FILES=$(LIBRARIES:=.cma)
+CMXA_FILES=$(LIBRARIES:=.cmxa)
+ML_LEX_FILES=$(LEX_MODULES:=.ml)
+ML_YACC_FILES=$(YACC_MODULES:=.ml)
+MLI_YACC_FILES=$(YACC_MODULES:=.mli)
+ML_FILES=$(ML_LEX_FILES) $(ML_YACC_FILES)
+O_FILES=$(C_FILES:=.o)
+ADD_CMO_FILES=$(ADD_MODULES:=.cmo)
+ADD_CMX_FILES=$(ADD_MODULES:=.cmx)
 
-GENERATED_SOURCES=$(patsubst %,%.ml,$(LEX_MODULES)) $(patsubst %,%.ml,$(YACC_MODULES)) $(patsubst %,%.mli,$(YACC_MODULES))
+GENERATED_SOURCES=$(ML_LEX_FILES) $(ML_YACC_FILES) $(MLI_YACC_FILES)
 
-ifdef C_FILES
-ADD_CFLAGS+=-custom
-endif
+CUSTOM_FLAG=`if [ -z "$(C_FILES)" ]; then true; else echo '-custom'; fi`
+ADD_CFLAGS+=$(CUSTOM_FLAG)
 
 default: compile run
 
@@ -20,8 +24,8 @@ compile: $(ML_FILES) $(CMO_FILES) $(CMX_FILES) $(MAIN_MODULE).cmo $(MAIN_MODULE)
        @for file in $(C_FILES); do \
          $(NATIVECC) $(NATIVECCCOMPOPTS) -c -I$(TOPDIR)/byterun $$file.c; \
        done;
-       @$(OCAMLC) $(ADD_COMPFLAGS) $(ADD_CFLAGS) -o program.byte $(O_FILES) $(CMA_FILES) $(CMO_FILES) $(patsubst %,%.cmo,$(ADD_MODULES)) $(MAIN_MODULE).cmo
-       @$(OCAMLOPT) $(ADD_COMPFLAGS) -o program.native $(O_FILES) $(CMXA_FILES) $(CMX_FILES) $(patsubst %,%.cmx,$(ADD_MODULES)) $(MAIN_MODULE).cmx
+       @$(OCAMLC) $(ADD_COMPFLAGS) $(ADD_CFLAGS) -o program.byte $(O_FILES) $(CMA_FILES) $(CMO_FILES) $(ADD_CMO_FILES) $(MAIN_MODULE).cmo
+       @$(OCAMLOPT) $(ADD_COMPFLAGS) -o program.native $(O_FILES) $(CMXA_FILES) $(CMX_FILES) $(ADD_CMX_FILES) $(MAIN_MODULE).cmx
 
 run:
        @printf " ... testing with ocamlc"
index 2e2982261958effd63784394e84617840491ddc9..099251321fdcd6aa8d3c784f0b1358f1b0876f66 100644 (file)
@@ -2,18 +2,20 @@
 
 CC=$(NATIVECC) $(NATIVECCCOMPOPTS)
 FC=$(FORTAN_COMPILER)
-CMO_FILES=$(patsubst %,%.cmo,$(MODULES))
-CMX_FILES=$(patsubst %,%.cmx,$(MODULES))
-CMA_FILES=$(patsubst %,%.cma,$(LIBRARIES))
-CMXA_FILES=$(patsubst %,%.cmxa,$(LIBRARIES))
-O_FILES=$(patsubst %,%.$(O),$(C_FILES) $(F_FILES))
-ifdef C_FILES
-ADD_CFLAGS+=-custom
-endif
-ifdef F_FILES
-ADD_CFLAGS+=$(FORTRAN_LIBRARY)
-ADD_OPTFLAGS+=$(FORTRAN_LIBRARY)
-endif
+CMO_FILES=$(MODULES:=.cmo)
+CMX_FILES=$(MODULES:=.cmx)
+CMA_FILES=$(LIBRARIES:=.cma)
+CMXA_FILES=$(LIBRARIES:=.cmxa)
+O_FILES=$(C_FILES:=.o)
+
+CUSTOM_FLAG=`if [ -z "$(C_FILES)" ]; then true; else echo '-custom'; fi`
+ADD_CFLAGS+=$(CUSTOM_FLAG)
+FORTRAN_LIB=`if [ -z "$(F_FILES)" ]; then true; else echo '$(FORTRAN_LIBRARY)'; fi`
+ADD_CFLAGS+=$(FORTRAN_LIB)
+ADD_OPTFLAGS+=$(FORTRAN_LIB)
+
+check:
+       @if [ -n "$(FORTRAN_COMPILER)" -o -z "$(F_FILES)" ]; then $(MAKE) run-all; fi
 
 run-all:
        @for file in $(C_FILES); do \
index c81a55c0bd45dd3aaa481053fa918e0d2c038808..583680deac2732726ff86096c3b449fb98e1a2f8 100644 (file)
@@ -96,7 +96,7 @@ ADD_COMPFLAGS=$(INCLUDES) -g
 
 default: arch codegen tests
 
-codegen: parsecmm.ml lexcmm.ml $(patsubst %.cmo,%.cmi,$(OBJS)) $(OBJS) main.cmo
+codegen: parsecmm.ml lexcmm.ml $(OBJS:.cmo=.cmi) $(OBJS) main.cmo
        @$(OCAMLC) $(LINKFLAGS) -o codegen $(OTHEROBJS) $(OBJS) main.cmo
 
 parsecmm.mli parsecmm.ml: parsecmm.mly
@@ -120,7 +120,7 @@ ARGS_tagged-integr=-DINT_FLOAT -DFUN=test main.c
 ARGS_tagged-quicksort=-DSORT -DFUN=quicksort main.c
 ARGS_tagged-tak=-DUNIT_INT -DFUN=takmain main.c
 
-tests: $(patsubst %,%.o,$(CASES))
+tests: $(CASES:=.o)
        @for c in $(CASES); do \
          printf " ... testing '$$c':"; \
          $(MAKE) one CC="$(CC) $(CFLAGS)" NAME=$$c; \
@@ -133,7 +133,7 @@ one:
 clean: defaultclean
        @rm -f ./codegen *.out
        @rm -f parsecmm.ml parsecmm.mli lexcmm.ml
-       @rm -f $(patsubst %,%.s,$(CASES))
+       @rm -f $(CASES:=.s)
 
 power.o: power-$(SYSTEM).o
        @cp power-$(SYSTEM).o power.o
index e40fecf7c34759a1c4139cced138f7ba32ab99e4..bb2dc2b0b690f3189311d8d931f485b3cc06b8ee 100644 (file)
 #define ALIGN 16
 #endif
 
-        .globl  _call_gen_code
+#ifdef SYS_macosx
+#define CALL_GEN_CODE _call_gen_code
+#define CAML_C_CALL _caml_c_call
+#define CAML_NEGF_MASK _caml_negf_mask
+#define CAML_ABSF_MASK _caml_absf_mask
+#else
+#define CALL_GEN_CODE call_gen_code
+#define CAML_C_CALL caml_c_call
+#define CAML_NEGF_MASK caml_negf_mask
+#define CAML_ABSF_MASK caml_absf_mask
+#endif
+
+        .globl  CALL_GEN_CODE
         .align  ALIGN
-_call_gen_code:
+CALL_GEN_CODE:
         pushq   %rbx
         pushq   %rbp
         pushq   %r12
@@ -41,9 +53,9 @@ _call_gen_code:
         popq    %rbx
         ret
 
-        .globl  caml_c_call
+        .globl  CAML_C_CALL
         .align  ALIGN
-caml_c_call:
+CAML_C_CALL:
         jmp     *%rax
 
 #ifdef SYS_macosx
@@ -51,13 +63,13 @@ caml_c_call:
 #else
        .section        .rodata.cst8,"aM",@progbits,8
 #endif
-        .globl  _caml_negf_mask
+        .globl  CAML_NEGF_MASK
         .align  ALIGN
-_caml_negf_mask:
+CAML_NEGF_MASK:
        .quad   0x8000000000000000, 0
-        .globl  _caml_absf_mask
+        .globl  CAML_ABSF_MASK
         .align  ALIGN
-_caml_absf_mask:
+CAML_ABSF_MASK:
        .quad   0x7FFFFFFFFFFFFFFF, 0
 
         .comm   young_limit, 8
index 74b861e7c7de1a411a940d221f79a0d173b2617b..9a7d2ba00e8cbb47cbc1bdd3c228fdd2070fd300 100644 (file)
@@ -1,4 +1,4 @@
-MODULES=
+#MODULES=
 MAIN_MODULE=io
 EXEC_ARGS=io.ml
 
index 9d645bed80534d3c537a667f2d942e6958e29368..b0edfabbb0508a823266d5e952b3e63764434d9d 100644 (file)
@@ -1,4 +1,4 @@
-MODULES=
+#MODULES=
 MAIN_MODULE=wc
 EXEC_ARGS=wc.ml
 
index 476745893ef35731c7c3f2a3d9a78c099fde0752..ef8a4f546b1136efa19344e5009c6176bc2f514f 100644 (file)
@@ -1,4 +1,4 @@
-MODULES=
+#MODULES=
 MAIN_MODULE=manyargs
 C_FILES=manyargsprim
 
index 133a3fe1a15b8a877896341dcded7d8e5e6a78ec..f69120c9ac80d6c25d3fd05b6840d124e59ad757 100644 (file)
@@ -76,5 +76,30 @@ let _ =
   test 40 eqftffff (cmpgen nan 0.0);
   test 41 eqftffff (cmpfloat nan nan);
   test 42 eqftffff (cmpfloat nan 0.0);
-  test 43 eqtrue ([||] = [||])
+  test 43 eqtrue ([||] = [||]);
+  (* Convoluted forms to test both the "positive" and "negative" cases
+     of float tests *)
+  let cmpfloatpos (x:float) (y:float) =
+    ((let r = ref false in (if x = y then r := true); !r),
+     (let r = ref false in (if x <> y then r := true); !r),
+     (let r = ref false in (if x < y then r := true); !r),
+     (let r = ref false in (if x <= y then r := true); !r),
+     (let r = ref false in (if x > y then r := true); !r),
+     (let r = ref false in (if x >= y then r := true); !r))
+  and cmpfloatneg (x:float) (y:float) =
+    ((let r = ref true in (if not (x = y) then r := false); !r),
+     (let r = ref true in (if not (x <> y) then r := false); !r),
+     (let r = ref true in (if not (x < y) then r := false); !r),
+     (let r = ref true in (if not (x <= y) then r := false); !r),
+     (let r = ref true in (if not (x > y) then r := false); !r),
+     (let r = ref true in (if not (x >= y) then r := false); !r)) in
+  let testcmpfloat x y =
+    cmpfloatpos x y = cmpgen x y &&
+    cmpfloatneg x y = cmpgen x y in
+  test 50 eqtrue (testcmpfloat nan nan);
+  test 51 eqtrue (testcmpfloat nan 0.0);
+  test 52 eqtrue (testcmpfloat 0.0 nan);
+  test 53 eqtrue (testcmpfloat 0.0 0.0);
+  test 54 eqtrue (testcmpfloat 1.0 0.0);
+  test 55 eqtrue (testcmpfloat 0.0 1.0)
 
index 1d5f140118a8dc1780698f5ab5efd080e365a0c0..6070a6b0a09e65899aa8935baf287f691bb7a4d9 100644 (file)
@@ -41,3 +41,9 @@ Test 40 passed.
 Test 41 passed.
 Test 42 passed.
 Test 43 passed.
+Test 50 passed.
+Test 51 passed.
+Test 52 passed.
+Test 53 passed.
+Test 54 passed.
+Test 55 passed.
index 3101f333586aac90574bf27d845535a5b81180ac..1cc37c1c67e1067c4b467112b8b3b06ac3e74970 100644 (file)
@@ -51,6 +51,35 @@ let l = function
 
 open Printf
 
+external string_create: int -> string = "caml_create_string"
+external unsafe_chr: int -> char = "%identity"
+external string_unsafe_set : string -> int -> char -> unit
+                           = "%string_unsafe_set"
+
+(* The following function is roughly equivalent to Char.escaped,
+   except that it is locale-independent. *)
+let escaped = function
+  | '\'' -> "\\'"
+  | '\\' -> "\\\\"
+  | '\n' -> "\\n"
+  | '\t' -> "\\t"
+  | '\r' -> "\\r"
+  | '\b' -> "\\b"
+  | c ->
+    if ((k c) <> "othr") && ((Char.code c) <= 191) then begin
+      let s = string_create 1 in
+      string_unsafe_set s 0 c;
+      s
+    end else begin
+      let n = Char.code c in
+      let s = string_create 4 in
+      string_unsafe_set s 0 '\\';
+      string_unsafe_set s 1 (unsafe_chr (48 + n / 100));
+      string_unsafe_set s 2 (unsafe_chr (48 + (n / 10) mod 10));
+      string_unsafe_set s 3 (unsafe_chr (48 + n mod 10));
+      s
+    end
+
 let _ =
   for i = -5 to 10 do printf "f(%d) = %d\n" i (f i) done;
   List.iter (fun i -> printf "g(%d) = %d\n" i (g i))
@@ -62,7 +91,7 @@ let _ =
   done;
   for i = 0 to 255 do
     let c = Char.chr i in
-    printf "k(%s) = %s\t" (Char.escaped c) (k c)
+    printf "k(%s) = %s\t" (escaped c) (k c)
   done;
   printf "\n";
   printf "p([|\"hello\"|]) = %s\n" (p [|"hello"|]);
index 7a35b13076db18c2c72a65042c46d80b0b9d5784..eb7dc978869bac5f06807da8904654e1856593fb 100644 (file)
@@ -57,7 +57,7 @@ h({) = ?
 h(|) = ?
 h(}) = ?
 h(~) = ?
-k(\000) = othr k(\001) = othr  k(\002) = othr  k(\003) = othr  k(\004) = othr  k(\005) = othr  k(\006) = othr  k(\007) = othr  k(\b) = othr    k(\t) = blk     k(\n) = blk     k(\011) = othr  k(\012) = othr  k(\r) = blk     k(\014) = othr  k(\015) = othr  k(\016) = othr  k(\017) = othr  k(\018) = othr  k(\019) = othr  k(\020) = othr  k(\021) = othr  k(\022) = othr  k(\023) = othr  k(\024) = othr  k(\025) = othr  k(\026) = othr  k(\027) = othr  k(\028) = othr  k(\029) = othr  k(\030) = othr  k(\031) = othr  k( ) = blk      k(!) = oper     k(") = othr     k(#) = oper     k($) = oper     k(%) = oper     k(&) = oper     k(\') = othr    k(() = othr     k()) = othr     k(*) = oper     k(+) = oper     k(,) = othr     k(-) = othr     k(.) = othr     k(/) = oper     k(0) = dig      k(1) = dig      k(2) = dig      k(3) = dig      k(4) = dig      k(5) = dig      k(6) = dig      k(7) = dig      k(8) = dig      k(9) = dig      k(:) = oper     k(;) = othr     k(<) = oper     k(=) = oper     k(>) = oper     k(?) = oper     k(@) = oper     k(A) = letr     k(B) = letr     k(C) = letr     k(D) = letr     k(E) = letr     k(F) = letr     k(G) = letr     k(H) = letr     k(I) = letr     k(J) = letr     k(K) = letr     k(L) = letr     k(M) = letr     k(N) = letr     k(O) = letr     k(P) = letr     k(Q) = letr     k(R) = letr     k(S) = letr     k(T) = letr     k(U) = letr     k(V) = letr     k(W) = letr     k(X) = letr     k(Y) = letr     k(Z) = letr     k([) = othr     k(\\) = oper    k(]) = othr     k(^) = oper     k(_) = othr     k(`) = othr     k(a) = letr     k(b) = letr     k(c) = letr     k(d) = letr     k(e) = letr     k(f) = letr     k(g) = letr     k(h) = letr     k(i) = letr     k(j) = letr     k(k) = letr     k(l) = letr     k(m) = letr     k(n) = letr     k(o) = letr     k(p) = letr     k(q) = letr     k(r) = letr     k(s) = letr     k(t) = letr     k(u) = letr     k(v) = letr     k(w) = letr     k(x) = letr     k(y) = letr     k(z) = letr     k({) = othr     k(|) = oper     k(}) = othr     k(~) = oper     k(\127) = othr  k(\128) = othr  k(\129) = othr  k(\130) = othr  k(\131) = othr  k(\132) = othr  k(\133) = othr  k(\134) = othr  k(\135) = othr  k(\136) = othr  k(\137) = othr  k(\138) = othr  k(\139) = othr  k(\140) = othr  k(\141) = othr  k(\142) = othr  k(\143) = othr  k(\144) = othr  k(\145) = othr  k(\146) = othr  k(\147) = othr  k(\148) = othr  k(\149) = othr  k(\150) = othr  k(\151) = othr  k(\152) = othr  k(\153) = othr  k(\154) = othr  k(\155) = othr  k(\156) = othr  k(\157) = othr  k(\158) = othr  k(\159) = othr  k( ) = othr     k(¡) = othr     k(¢) = othr     k(£) = othr     k(¤) = othr     k(¥) = othr     k(¦) = othr     k(§) = othr     k(¨) = othr     k(©) = othr     k(ª) = othr     k(«) = othr     k(¬) = othr     k(­) = othr     k(®) = othr     k(¯) = othr     k(°) = othr     k(±) = othr     k(²) = othr     k(³) = othr     k(´) = othr     k(µ) = othr     k(¶) = othr     k(·) = othr     k(¸) = othr     k(¹) = othr     k(º) = othr     k(») = othr     k(¼) = othr     k(½) = othr     k(¾) = othr     k(¿) = othr     k(À) = letr     k(Á) = letr     k(Â) = letr     k(Ã) = letr     k(Ä) = letr     k(Å) = letr     k(Æ) = letr     k(Ç) = letr     k(È) = letr     k(É) = letr     k(Ê) = letr     k(Ë) = letr     k(Ì) = letr     k(Í) = letr     k(Î) = letr     k(Ï) = letr     k(Ð) = letr     k(Ñ) = letr     k(Ò) = letr     k(Ó) = letr     k(Ô) = letr     k(Õ) = letr     k(Ö) = letr     k(×) = letr     k(Ø) = letr     k(Ù) = letr     k(Ú) = letr     k(Û) = letr     k(Ü) = letr     k(Ý) = letr     k(Þ) = letr     k(ß) = letr     k(à) = letr     k(á) = letr     k(â) = letr     k(ã) = letr     k(ä) = letr     k(å) = letr     k(æ) = letr     k(ç) = letr     k(è) = letr     k(é) = letr     k(ê) = letr     k(ë) = letr     k(ì) = letr     k(í) = letr     k(î) = letr     k(ï) = letr     k(ð) = letr     k(ñ) = letr     k(ò) = letr     k(ó) = letr     k(ô) = letr     k(õ) = letr     k(ö) = letr     k(÷) = letr     k(ø) = letr     k(ù) = letr     k(ú) = letr     k(û) = letr     k(ü) = letr     k(ý) = letr     k(þ) = letr     k(ÿ) = letr     
+k(\000) = othr k(\001) = othr  k(\002) = othr  k(\003) = othr  k(\004) = othr  k(\005) = othr  k(\006) = othr  k(\007) = othr  k(\b) = othr    k(\t) = blk     k(\n) = blk     k(\011) = othr  k(\012) = othr  k(\r) = blk     k(\014) = othr  k(\015) = othr  k(\016) = othr  k(\017) = othr  k(\018) = othr  k(\019) = othr  k(\020) = othr  k(\021) = othr  k(\022) = othr  k(\023) = othr  k(\024) = othr  k(\025) = othr  k(\026) = othr  k(\027) = othr  k(\028) = othr  k(\029) = othr  k(\030) = othr  k(\031) = othr  k( ) = blk      k(!) = oper     k(\034) = othr  k(#) = oper     k($) = oper     k(%) = oper     k(&) = oper     k(\') = othr    k(\040) = othr  k(\041) = othr  k(*) = oper     k(+) = oper     k(\044) = othr  k(\045) = othr  k(\046) = othr  k(/) = oper     k(0) = dig      k(1) = dig      k(2) = dig      k(3) = dig      k(4) = dig      k(5) = dig      k(6) = dig      k(7) = dig      k(8) = dig      k(9) = dig      k(:) = oper     k(\059) = othr  k(<) = oper     k(=) = oper     k(>) = oper     k(?) = oper     k(@) = oper     k(A) = letr     k(B) = letr     k(C) = letr     k(D) = letr     k(E) = letr     k(F) = letr     k(G) = letr     k(H) = letr     k(I) = letr     k(J) = letr     k(K) = letr     k(L) = letr     k(M) = letr     k(N) = letr     k(O) = letr     k(P) = letr     k(Q) = letr     k(R) = letr     k(S) = letr     k(T) = letr     k(U) = letr     k(V) = letr     k(W) = letr     k(X) = letr     k(Y) = letr     k(Z) = letr     k(\091) = othr  k(\\) = oper    k(\093) = othr  k(^) = oper     k(\095) = othr  k(\096) = othr  k(a) = letr     k(b) = letr     k(c) = letr     k(d) = letr     k(e) = letr     k(f) = letr     k(g) = letr     k(h) = letr     k(i) = letr     k(j) = letr     k(k) = letr     k(l) = letr     k(m) = letr     k(n) = letr     k(o) = letr     k(p) = letr     k(q) = letr     k(r) = letr     k(s) = letr     k(t) = letr     k(u) = letr     k(v) = letr     k(w) = letr     k(x) = letr     k(y) = letr     k(z) = letr     k(\123) = othr  k(|) = oper     k(\125) = othr  k(~) = oper     k(\127) = othr  k(\128) = othr  k(\129) = othr  k(\130) = othr  k(\131) = othr  k(\132) = othr  k(\133) = othr  k(\134) = othr  k(\135) = othr  k(\136) = othr  k(\137) = othr  k(\138) = othr  k(\139) = othr  k(\140) = othr  k(\141) = othr  k(\142) = othr  k(\143) = othr  k(\144) = othr  k(\145) = othr  k(\146) = othr  k(\147) = othr  k(\148) = othr  k(\149) = othr  k(\150) = othr  k(\151) = othr  k(\152) = othr  k(\153) = othr  k(\154) = othr  k(\155) = othr  k(\156) = othr  k(\157) = othr  k(\158) = othr  k(\159) = othr  k(\160) = othr  k(\161) = othr  k(\162) = othr  k(\163) = othr  k(\164) = othr  k(\165) = othr  k(\166) = othr  k(\167) = othr  k(\168) = othr  k(\169) = othr  k(\170) = othr  k(\171) = othr  k(\172) = othr  k(\173) = othr  k(\174) = othr  k(\175) = othr  k(\176) = othr  k(\177) = othr  k(\178) = othr  k(\179) = othr  k(\180) = othr  k(\181) = othr  k(\182) = othr  k(\183) = othr  k(\184) = othr  k(\185) = othr  k(\186) = othr  k(\187) = othr  k(\188) = othr  k(\189) = othr  k(\190) = othr  k(\191) = othr  k(\192) = letr  k(\193) = letr  k(\194) = letr  k(\195) = letr  k(\196) = letr  k(\197) = letr  k(\198) = letr  k(\199) = letr  k(\200) = letr  k(\201) = letr  k(\202) = letr  k(\203) = letr  k(\204) = letr  k(\205) = letr  k(\206) = letr  k(\207) = letr  k(\208) = letr  k(\209) = letr  k(\210) = letr  k(\211) = letr  k(\212) = letr  k(\213) = letr  k(\214) = letr  k(\215) = letr  k(\216) = letr  k(\217) = letr  k(\218) = letr  k(\219) = letr  k(\220) = letr  k(\221) = letr  k(\222) = letr  k(\223) = letr  k(\224) = letr  k(\225) = letr  k(\226) = letr  k(\227) = letr  k(\228) = letr  k(\229) = letr  k(\230) = letr  k(\231) = letr  k(\232) = letr  k(\233) = letr  k(\234) = letr  k(\235) = letr  k(\236) = letr  k(\237) = letr  k(\238) = letr  k(\239) = letr  k(\240) = letr  k(\241) = letr  k(\242) = letr  k(\243) = letr  k(\244) = letr  k(\245) = letr  k(\246) = letr  k(\247) = letr  k(\248) = letr  k(\249) = letr  k(\250) = letr  k(\251) = letr  k(\252) = letr  k(\253) = letr  k(\254) = letr  k(\255) = letr  
 p([|"hello"|]) = hello
 p([|1.0|]) = 1.000000
 q([|2|]) = 2
index 71082b9fe0ad03cbbe0b0f79b869581a08f199c7..f07d6751bacb4989c440a3acd2653036abd912db 100644 (file)
@@ -1,4 +1,4 @@
-MODULES=
+#MODULES=
 MAIN_MODULE=globroots
 C_FILES=globrootsprim
 ADD_COMPFLAGS=-w a
index 6d222274b36ae084fe849bbc7ba9ac06782e27c5..e81a715ad151e5fdebe737391925f0f3882575a2 100644 (file)
@@ -1,4 +1,4 @@
-MODULES=
+#MODULES=
 MAIN_MODULE=md5
 ADD_COMPFLAGS=-w a
 
index 33c431b122b9b3a3fc51a02af6070b191060e2ca..00ffc63ad30e849807de4c1f08343ba7b94b2f53 100644 (file)
@@ -16,17 +16,17 @@ compile:
 
 run:
        @printf " ... testing 'main'"
-       @./main plug1.cma plug2.cma > main.result
+       @export LD_LIBRARY_PATH=`pwd` && ./main plug1.cma plug2.cma > main.result
        @diff -q main.reference main.result > /dev/null || (echo " => failed" && exit 1)
        @echo " => passed"
 
        @printf " ... testing 'static'"
-       @./static > static.result
+       @export LD_LIBRARY_PATH=`pwd` && ./static > static.result
        @diff -q static.reference static.result > /dev/null || (echo " => failed" && exit 1)
        @echo " => passed"
 
        @printf " ... testing 'custom'"
-       @./custom > custom.result
+       @export LD_LIBRARY_PATH=`pwd` && ./custom > custom.result
        @diff -q custom.reference custom.result > /dev/null || (echo " => failed" && exit 1)
        @echo " => passed"
 
index 0d28b8d953becb29c583abfce6362db29ef69321..df63a1fd56eeb95b04c2eefd94b2cdaa4974f54b 100644 (file)
@@ -1,4 +1,4 @@
-MODULES=
+#MODULES=
 MAIN_MODULE=intext
 C_FILES=intextaux
 
index 274cef905846f35675d51bf99ffa890bd3c624e4..8a78296e423d77b343254da8101d3210ebddeec9 100644 (file)
@@ -78,7 +78,9 @@ xor_big_int
 shift_left_big_int
  1... 2... 2... 3... 4... 5... 6...
 shift_right_big_int
- 1... 2... 3... 4... 5...
+ 1... 2... 3... 4... 5... 6...
+shift_right_towards_zero_big_int
+ 1... 2...
 extract_big_int
  1... 2... 3... 4... 5... 6...
 create_ratio
index 3474dd414ef4eabf2deb6fdffa4ddd6338c3fc2a..46ffc597283db9973e48f4927f4fe14fde1732b7 100644 (file)
@@ -888,7 +888,19 @@ test 4 eq_big_int
    big_int_of_string "39614081257132168796771975168");;
 test 5 eq_big_int
   (shift_right_big_int (big_int_of_string "-5299989648942") 32,
+   big_int_of_int (-1235));;
+test 6 eq_big_int
+  (shift_right_big_int (big_int_of_string "-16570089876543209725755392") 27,
+   big_int_of_string "-123456790123456789");;
+
+testing_function "shift_right_towards_zero_big_int";;
+
+test 1 eq_big_int
+  (shift_right_towards_zero_big_int (big_int_of_string "-5299989648942") 32,
    big_int_of_int (-1234));;
+test 2 eq_big_int
+  (shift_right_towards_zero_big_int (big_int_of_string "-16570089876543209725755392") 27,
+   big_int_of_string "-123456790123456789");;
 
 testing_function "extract_big_int";;
 
index 0be4bf14e6b3f287b26cbb5fa18087cff6b123b3..8f8b3c5b645aed8563d996c80771473399f5f034 100644 (file)
@@ -1,4 +1,4 @@
-MODULES=
+#MODULES=
 MAIN_MODULE=tscanf
 ADD_COMPFLAGS=-I $(BASEDIR)/lib
 ADD_MODULES=testing
index c6fa1f544f4a3fb46d58dca6a1fd4a5befba9b66..cab4d7be4d2caf1d15876f9e499eb65bc20c1a18 100644 (file)
@@ -514,7 +514,7 @@ let test22 () =
 test (test22 ())
 ;;
 
-(* Should work and does not with this version of scan_int_list!
+(* Should work but does not with this version of scan_int_list!
 scan_int_list (Scanning.from_string "[1;2;3;4; ]");;
 (* Should lead to a bad input error. *)
 scan_int_list (Scanning.from_string "[1;2;3;4 5]");;
@@ -918,10 +918,10 @@ let scan_float_list_list =
 (* The killer way to define [scan_float_list_list]. *)
 (* let scan_float_list_list = scan_list scan_float_list;; *)
 
-test (
+let test340 () =
   scan_float_list_list
    (Scanning.from_string "[[1.0] ; []; [2.0; 3; 5.0; 6.];]") =
- [[1.]; []; [2.; 3.; 5.; 6.]])
+  [[1.]; []; [2.; 3.; 5.; 6.]]
 ;;
 
 (* A general scan_list_list functional. *)
@@ -945,7 +945,7 @@ let test35 () =
   sscanf " " "%N%s%N" (fun x s y -> x, s, y) = (0, "", 1)
 ;;
 
-test (test35 ())
+test (test340 () && test35 ())
 ;;
 
 (* The prefered reader functionnals. *)
@@ -1127,7 +1127,39 @@ let test48 () =
   (* Complex test of scanning a meta format specified in the scanner input
      format string and extraction of its specification from a string. *)
   sscanf "12 \"%i\"89 " "%i %{%d%}%s %!"
-    (fun i f s -> i = 12 && f = "%i" && s = "89")
+    (fun i f s -> i = 12 && f = "%i" && s = "89") &&
+  (* Testing scanf format string replacement *)
+  let k s =
+    Scanf.sscanf s
+      "%(%f%)" (fun _fmt i -> i) in
+  k "\" : %1f\": 987654321" = 9.0  &&
+  k "\" : %2f\": 987654321" = 98.0 &&
+  k "\" : %3f\": 9.87654321" = 9.8 &&
+  k "\" : %4f\": 9.87654321" = 9.87 &&
+
+  let h s =
+    Scanf.sscanf s
+      "Read integers with %(%i%)" (fun _fmt i -> i) in
+  h "Read integers with \"%1d\"987654321" = 9  &&
+  h "Read integers with \"%2d\"987654321" = 98 &&
+  h "Read integers with \"%3u\"987654321" = 987 &&
+  h "Read integers with \"%4x\"987654321" = 39030 &&
+
+  let i s =
+    Scanf.sscanf s
+      "with %(%i %s%)" (fun _fmt amount currency -> amount, currency) in
+  i "with \" : %d %s\" :        21 euros" = (21, "euros")  &&
+  i "with \" : %d %s\" : 987654321 dollars" = (987654321, "dollars") &&
+  i "with \" : %u %s\" :     54321 pounds" = (54321, "pounds") &&
+  i "with \" : %x %s\" :       321 yens" = (801, "yens") &&
+
+  let j s =
+    Scanf.sscanf s
+      "with %(%i %_s %s%)" (fun _fmt amount currency -> amount, currency) in
+  j "with \" : %1d %_s %s\" : 987654321 euros" = (9, "euros")  &&
+  j "with \" : %2d %_s %s\" : 987654321 dollars" = (98, "dollars") &&
+  j "with \" : %3u %_s %s\" : 987654321 pounds" = (987, "pounds") &&
+  j "with \" : %4x %_s %s\" : 987654321 yens" = (39030, "yens")
 ;;
 
 test (test48 ())
@@ -1377,7 +1409,7 @@ test (test56 ())
 ;;
 
 (* Testing the scanning of formats. *)
-let test48 () =
+let test57 () =
   (* Testing format_from_string. *)
   let test_format_scan s fmt efmt =
     format_from_string s fmt = efmt in
@@ -1409,6 +1441,17 @@ let test48 () =
     (fun i f s -> i = 12 && f = "%i" && s = "89")
 ;;
 
+test (test57 ())
+;;
+
+(*
+let test58 () =
+;;
+
+test (test58 ())
+;;
+*)
+
 (* To be continued ...
 (* Trying to scan records. *)
 let rec scan_fields ib scan_field accu =
index 62f05380e5ded78f95ffb94df0074939d619e698..4945c1f805a866557a7118dafa290cc3cd6a94f2 100644 (file)
@@ -20,6 +20,6 @@ run:
        done
 
 clean: defaultclean
-       @rm -f *.byte *.native *.result
+       @rm -f *.bytecode *.native *.result
 
 include ../../makefiles/Makefile.common
index e61924e6ff690e1d185543412523cff657835ca3..5e7398ba7d7e02626abeda8a2cf81e65bb804ebe 100644 (file)
@@ -6,9 +6,12 @@ run: $(CUSTOM_MODULE).cmo
          printf " ... testing '$$file'"; \
          $(OCAMLDOC) -g $(CUSTOM_MODULE).cmo -o `basename $$file ml`result $$file; \
          diff -q `basename $$file ml`reference `basename $$file ml`result > /dev/null && echo " => passed" || (echo " => failed" && exit 1); \
-       done
+       done;
+       @$(OCAMLDOC) -html t*.ml 2>&1 | grep -v test_types_display || true
+       @$(OCAMLDOC) -latex t*.ml 2>&1 | grep -v test_types_display || true
+
 
 clean: defaultclean
-       @rm -f *.result
+       @rm -f *.result *.html *.tex *.log *.out *.sty *.toc *.css *.aux
 
 include ../../makefiles/Makefile.common
diff --git a/testsuite/tests/tool-ocamldoc/t02.ml b/testsuite/tests/tool-ocamldoc/t02.ml
new file mode 100644 (file)
index 0000000..d7c9742
--- /dev/null
@@ -0,0 +1,10 @@
+module Foo = struct type u type t = int let x = 1 end;;
+module type TFoo = module type of Foo;;
+
+module type TBar = TFoo with type u := float;;
+
+module type Gee =
+  sig
+    module M : module type of Foo
+    include module type of Foo
+  end
diff --git a/testsuite/tests/tool-ocamldoc/t02.reference b/testsuite/tests/tool-ocamldoc/t02.reference
new file mode 100644 (file)
index 0000000..f1e7de4
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# module T02:
+#
+# module T02.Foo:
+#
+# module type T02.TFoo:
+#
+# module type T02.TBar:
+#
+# module type T02.Gee:
+#
+# module T02.Gee.M:
diff --git a/testsuite/tests/tool-ocamldoc/t03.ml b/testsuite/tests/tool-ocamldoc/t03.ml
new file mode 100644 (file)
index 0000000..43f1857
--- /dev/null
@@ -0,0 +1,7 @@
+module Foo = struct type t = int let x = 1 end;;
+module type MT = module type of Foo;;
+module Bar = struct type t = int let x = 2 end;;
+
+module type MT2 = sig type t val x : t end;;
+module type Gee = MT2 with type t = float ;;
+module T = (val (if true then (module Foo:MT2 with type t = int) else (module Bar: MT2 with type t = int)) : MT2 with type t = int);;
\ No newline at end of file
diff --git a/testsuite/tests/tool-ocamldoc/t03.reference b/testsuite/tests/tool-ocamldoc/t03.reference
new file mode 100644 (file)
index 0000000..174e219
--- /dev/null
@@ -0,0 +1,14 @@
+#
+# module T03:
+#
+# module T03.Foo:
+#
+# module type T03.MT:
+#
+# module T03.Bar:
+#
+# module type T03.MT2:
+#
+# module type T03.Gee:
+#
+# module T03.T:
index 68001d766f40baa0c45dad4bd695c7cca170f585..a8a96229107c502621948be4235d8068c26f1ea2 100644 (file)
@@ -1,4 +1,4 @@
-MODULES=
+#MODULES=
 MAIN_MODULE=fstclassmod
 ADD_COMPFLAGS=-w a
 
index 42fa5963f08b3317992bd4886f5323810029c4d1..aa95aaead6ef8cea25ac8b716997dbf626cfd3a3 100644 (file)
@@ -121,41 +121,9 @@ Type point = point is not a subtype of color_point = color_point
       print_string (self#color);
       print_string ")"
   end;;
-\e[mWarning 7: the following methods are overriden by the class printable_point :
-  get_x move
-\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A# 
-  class printable_color_point y c = object (self)
-    inherit color_point y c
-    inherit \e[4mprintable_point y\e[m as super
-    method print =
-      print_string "(";
-      super#print;
-      print_string ", ";
-      print_string (self#color);
-      print_string ")"
-  end;;
-\e[m
-
-Warning 13: the following instance variables are overriden by the class printable_point :
+\e[mWarning 13: the following instance variables are overriden by the class printable_point :
   x
 The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
-\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A# 
-  class printable_color_point y c = object (self)
-    inherit color_point y c
-    inherit printable_point y as super
-    \e[4mmethod print =
-      print_string "(";
-      super#print;
-      print_string ", ";
-      print_string (self#color);
-      print_string ")"\e[m
-  end;;
-\e[m
-
-
-
-
-Warning 7: the method print is overridden.
 class printable_color_point :
   int ->
   string ->
@@ -304,18 +272,7 @@ val pr : < x : int; .. > list -> unit = <fun>
     method set_x : 'a -> unit
     method x : 'a
   end
-#                   \e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A# 
-  class ['a] double_link x = object (self)
-    inherit ['a] link x
-    val mutable prev = None
-    method prev = prev
-    \e[4mmethod  set_next l =
-           next <- l;
-           match l with Some l -> l#set_prev (Some self) | None -> ()\e[m
-    method  set_prev l = prev <- l
-  end;;
-\e[mWarning 7: the method set_next is overridden.
-class ['a] double_link :
+#                   class ['a] double_link :
   'a ->
   object ('b)
     val mutable next : 'b option
@@ -362,85 +319,7 @@ class ['a] double_link :
 #   - : float = 5.
 # - : float = 1.5
 # - : float = 15.
-#                                 \e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A# 
-  class calculator arg acc = object (self)
-    val arg = arg
-    val acc = acc
-    method enter n = new calculator n acc
-    method add = new calculator_add arg self#equals
-    method sub = new calculator_sub arg self#equals
-    method equals = arg
-  end and calculator_add arg acc = object
-    inherit calculator arg acc
-    \e[4mmethod enter n = new calculator_add n acc\e[m
-    method equals = acc +. arg
-  end and calculator_sub arg acc = object
-    inherit calculator arg acc
-    method enter n = new calculator_sub n acc
-    method equals = acc -. arg
-  end;;
-\e[mWarning 7: the method enter is overridden.
-\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A# 
-  class calculator arg acc = object (self)
-    val arg = arg
-    val acc = acc
-    method enter n = new calculator n acc
-    method add = new calculator_add arg self#equals
-    method sub = new calculator_sub arg self#equals
-    method equals = arg
-  end and calculator_add arg acc = object
-    inherit calculator arg acc
-    method enter n = new calculator_add n acc
-    \e[4mmethod equals = acc +. arg\e[m
-  end and calculator_sub arg acc = object
-    inherit calculator arg acc
-    method enter n = new calculator_sub n acc
-    method equals = acc -. arg
-  end;;
-\e[m
-Warning 7: the method equals is overridden.
-\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A# 
-  class calculator arg acc = object (self)
-    val arg = arg
-    val acc = acc
-    method enter n = new calculator n acc
-    method add = new calculator_add arg self#equals
-    method sub = new calculator_sub arg self#equals
-    method equals = arg
-  end and calculator_add arg acc = object
-    inherit calculator arg acc
-    method enter n = new calculator_add n acc
-    method equals = acc +. arg
-  end and calculator_sub arg acc = object
-    inherit calculator arg acc
-    \e[4mmethod enter n = new calculator_sub n acc\e[m
-    method equals = acc -. arg
-  end;;
-\e[m
-
-Warning 7: the method enter is overridden.
-\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A# 
-  class calculator arg acc = object (self)
-    val arg = arg
-    val acc = acc
-    method enter n = new calculator n acc
-    method add = new calculator_add arg self#equals
-    method sub = new calculator_sub arg self#equals
-    method equals = arg
-  end and calculator_add arg acc = object
-    inherit calculator arg acc
-    method enter n = new calculator_add n acc
-    method equals = acc +. arg
-  end and calculator_sub arg acc = object
-    inherit calculator arg acc
-    method enter n = new calculator_sub n acc
-    \e[4mmethod equals = acc -. arg\e[m
-  end;;
-\e[m
-
-
-Warning 7: the method equals is overridden.
-class calculator :
+#                                 class calculator :
   float ->
   float ->
   object
index 5c26800ed05a29c9cf6d7eb382db84f1f94e46e1..d93c5ec0ab39d7a5d5410b97a508b21c736e8cc3 100644 (file)
@@ -151,65 +151,14 @@ and 'a t = 'a t u
 # class ['a] c : 'a #c -> object  end
 #     class c : unit -> object method f : int end
 and d : unit -> object method f : int end
-# \e[A# class e () = object inherit c () inherit \e[4md ()\e[m end;;
-\e[mWarning 7: the following methods are overriden by the class d :
-  f
-class e : unit -> object method f : int end
+# class e : unit -> object method f : int end
 # - : int = 2
 # \e[A# class c () = object val x = - \e[4mtrue\e[m val y = -. () end;;
 \e[mError: This expression has type bool but an expression was expected of type
          int
 #   class c : unit -> object method f : int method g : int method h : int end
 # class d : unit -> object method h : int method i : int method j : int end
-#               \e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A# class e () = object
-    method f = 3
-    inherit \e[4mc ()\e[m
-    method g = 3
-    method i = 3
-    inherit d ()
-    method j = 3
-  end;;
-\e[mWarning 7: the following methods are overriden by the class c :
-  f
-\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A# class e () = object
-    method f = 3
-    inherit c ()
-    \e[4mmethod g = 3\e[m
-    method i = 3
-    inherit d ()
-    method j = 3
-  end;;
-\e[m
-
-Warning 7: the method g is overridden.
-\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A# class e () = object
-    method f = 3
-    inherit c ()
-    method g = 3
-    method i = 3
-    inherit \e[4md ()\e[m
-    method j = 3
-  end;;
-\e[m
-
-
-Warning 7: the following methods are overriden by the class d :
-  h i
-\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A# class e () = object
-    method f = 3
-    inherit c ()
-    method g = 3
-    method i = 3
-    inherit d ()
-    \e[4mmethod j = 3\e[m
-  end;;
-\e[m
-
-
-
-
-Warning 7: the method j is overridden.
-class e :
+#               class e :
   unit ->
   object
     method f : int
index 9187c71220d7be1830b9b3b8c2306ded06e2fad8..8b1b45a66cc96e7ca04b95f80be53bd68663b9b2 100644 (file)
@@ -218,23 +218,8 @@ val f4 : id -> int * bool = <fun>
   end
 #     val id : 'a -> 'a = <fun>
 #       class c : object method id : 'a -> 'a end
-#         \e[A\e[A\e[A\e[A\e[A# class c' = object
-    inherit c
-    \e[4mmethod id = id\e[m
-  end
-  ;;
-\e[mWarning 7: the method id is overridden.
-class c' : object method id : 'a -> 'a end
-#               \e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A# class d = object
-    inherit c as c
-    val mutable count = 0
-    \e[4mmethod id x = count <- count+1; x\e[m
-    method count = count
-    method old : 'a. 'a -> 'a = c#id
-  end
-  ;;
-\e[mWarning 7: the method id is overridden.
-class d :
+#         class c' : object method id : 'a -> 'a end
+#               class d :
   object
     val mutable count : int
     method count : int
index 48b47f3c87ca26d50e94048dbabfbe4d48fd7420..e599b19c131c399a394f9a3c99777e3b5623bb4b 100644 (file)
@@ -204,23 +204,8 @@ and b : object method id : 'a -> 'a end
   end
 #     val id : 'a -> 'a = <fun>
 #       class c : object method id : 'a -> 'a end
-#         \e[A\e[A\e[A\e[A\e[A# class c' = object
-    inherit c
-    \e[4mmethod id = id\e[m
-  end
-  ;;
-\e[mWarning 7: the method id is overridden.
-class c' : object method id : 'a -> 'a end
-#               \e[A\e[A\e[A\e[A\e[A\e[A\e[A\e[A# class d = object
-    inherit c as c
-    val mutable count = 0
-    \e[4mmethod id x = count <- count+1; x\e[m
-    method count = count
-    method old : 'a. 'a -> 'a = c#id
-  end
-  ;;
-\e[mWarning 7: the method id is overridden.
-class d :
+#         class c' : object method id : 'a -> 'a end
+#               class d :
   object
     val mutable count : int
     method count : int
diff --git a/testsuite/tests/typing-private-bugs/Makefile b/testsuite/tests/typing-private-bugs/Makefile
new file mode 100644 (file)
index 0000000..9375ddb
--- /dev/null
@@ -0,0 +1,2 @@
+include ../../makefiles/Makefile.okbad
+include ../../makefiles/Makefile.common
diff --git a/testsuite/tests/typing-private-bugs/pr5026_bad.ml b/testsuite/tests/typing-private-bugs/pr5026_bad.ml
new file mode 100644 (file)
index 0000000..0e6d215
--- /dev/null
@@ -0,0 +1,11 @@
+type untyped;;
+type -'a typed = private untyped;;
+type -'typing wrapped = private sexp
+and +'a t = 'a typed wrapped
+and sexp = private untyped wrapped;;
+class type ['a] s3 = object 
+  val underlying : 'a t
+end;;
+class ['a] s3object r : ['a] s3 = object
+  val underlying = r
+end;;
index 6ac1ce1366a91dc9010cff8dcffa4dfd95077cfc..ef9558e19e5dce2ab7d6ba0c5108550d9176666a 100644 (file)
@@ -1,4 +1,4 @@
-MODULES=
+#MODULES=
 MAIN_MODULE=newtype
 ADD_COMPFLAGS=-w a
 
index 477ba73a2ac6946e28f96eaa29b23211e1799439..1abf73b4bb36b95d114e3578d47afe4da2204cff 100644 (file)
@@ -66,7 +66,7 @@ ocamlprof: $(CSLPROF) profiling.cmo
        $(CAMLC) $(LINKFLAGS) -o ocamlprof $(CSLPROF_IMPORTS) $(CSLPROF)
 
 ocamlcp: ocamlcp.cmo
-       $(CAMLC) $(LINKFLAGS) -o ocamlcp main_args.cmo ocamlcp.cmo
+       $(CAMLC) $(LINKFLAGS) -o ocamlcp warnings.cmo main_args.cmo ocamlcp.cmo
 
 install::
        cp ocamlprof $(BINDIR)/ocamlprof$(EXE)
index 7c8d725fb7b36eabd3883f70cfd937e5a2c3080e..a2232dc15dbf9af29fc63933127093ff7305df0e 100644 (file)
@@ -84,6 +84,7 @@ module Options = Main_args.Make_bytecomp_options (struct
   let _verbose = option "-verbose"
   let _w = option_with_arg "-w"
   let _warn_error = option_with_arg "-warn-error"
+  let _warn_help = option "-warn-help"
   let _where = option "-where"
   let _nopervasives = option "-nopervasives"
   let _dparsetree = option "-dparsetree"
index 3575abbbac013a046276aeee7f7bec6242500b73..388e725786c3a5a838d14e990f7be8358a5a6f78 100644 (file)
@@ -77,6 +77,7 @@ module Options = Main_args.Make_opttop_options (struct
   let _version () = print_version ()
   let _w s = Warnings.parse_options false s
   let _warn_error s = Warnings.parse_options true s
+  let _warn_help = Warnings.help_warnings
 
   let _dparsetree = set dump_parsetree
   let _drawlambda = set dump_rawlambda
index 906aeb433412a0f7025f2cff0ec74cbea9e7b04f..a5e8b03f24e41396aace89674e63d8fa2cacb021 100644 (file)
@@ -16,4 +16,4 @@ Translclass Translmod Simplif Runtimedef
 Meta Instruct Bytegen Printinstr Opcodes Emitcode
 Bytesections Dll Symtable Bytelink Bytelibrarian Bytepackager
 
-Pparse Errors Compile Genprintval Toploop Trace Topdirs Topmain
+Pparse Errors Compile Main_args Genprintval Toploop Trace Topdirs Topmain
index b63eefcb43c8db3f32f1b18074e0ac7a9b4cf839..803624c5e26e712ae1a8f61b08fcfaf857220497 100644 (file)
@@ -71,6 +71,7 @@ module Options = Main_args.Make_bytetop_options (struct
   let _version () = print_version ()
   let _w s = Warnings.parse_options false s
   let _warn_error s = Warnings.parse_options true s
+  let _warn_help = Warnings.help_warnings
   let _dparsetree = set dump_parsetree
   let _drawlambda = set dump_rawlambda
   let _dlambda = set dump_lambda
index 4b9e84b223735d266cc349bc87612c2e1e02f3d3..fb4cc62b430eb38dc3f37155b59c3c0c7edbb675 100644 (file)
@@ -1251,7 +1251,7 @@ let rec non_recursive_abbrev env ty0 ty =
     match ty.desc with
       Tconstr(p, args, abbrev) ->
         begin try
-          non_recursive_abbrev env ty0 (try_expand_once env ty)
+          non_recursive_abbrev env ty0 (try_expand_once_opt env ty)
         with Cannot_expand ->
           if !Clflags.recursive_types then () else
           iter_type_expr (non_recursive_abbrev env ty0) ty
@@ -3183,7 +3183,7 @@ let cyclic_abbrev env id ty =
       Tconstr (p, tl, abbrev) ->
         p = Path.Pident id || List.memq ty seen ||
         begin try
-          check_cycle (ty :: seen) (expand_abbrev env ty)
+          check_cycle (ty :: seen) (expand_abbrev_opt env ty)
         with
           Cannot_expand -> false
         | Unify _ -> true
@@ -3297,6 +3297,8 @@ let rec nondep_type_rec env id ty =
             end
           else
             Tconstr(p, List.map (nondep_type_rec env id) tl, ref Mnil)
+      | Tpackage(p, _, _) when Path.isfree id p ->
+          raise Not_found
       | Tobject (t1, name) ->
           Tobject (nondep_type_rec env id t1,
                  ref (match !name with
index c7bcb61daaf41e540b1b0eeafff5e57a3f1bdf96..044247990637c559301f9400cb0eb7572abe66ab 100644 (file)
@@ -739,32 +739,10 @@ let add_item comp env =
   | Tsig_class(id, decl, _)  -> add_class id decl env
   | Tsig_cltype(id, decl, _) -> add_cltype id decl env
 
-(* Remove a previous identifier with same name *)
-let rec filter_value id = function
-    Env_empty -> Env_empty
-  | Env_value (sum, id', vd) ->
-      if Ident.equal id id' then sum
-      else Env_value(filter_value id sum, id', vd)
-  | Env_type (sum, id', td) -> Env_type (filter_value id sum, id', td)
-  | Env_exception (sum, id', ed) -> Env_exception (filter_value id sum, id', ed)
-  | Env_module (sum, id', mty) -> Env_module (filter_value id sum, id', mty)
-  | Env_modtype (sum, id', mty) -> Env_modtype (filter_value id sum, id', mty)
-  | Env_class (sum, id', cty) -> Env_class (filter_value id sum, id', cty)
-  | Env_cltype (sum, id', cty) -> Env_cltype (filter_value id sum, id', cty)
-  | Env_open (sum, path) -> Env_open (filter_value id sum, path)
-
-let remove_value id env =
-  { env with summary = filter_value id env.summary }
-
-let add_item_for_signature comp env =
-  match comp with
-    Tsig_value(id, decl) -> add_value id decl (remove_value id env)
-  | _ -> add_item comp env
-
 let rec add_signature sg env =
   match sg with
     [] -> env
-  | comp :: rem -> add_signature rem (add_item_for_signature comp env)
+  | comp :: rem -> add_signature rem (add_item comp env)
 
 (* Open a signature path *)
 
index 048e2d992e4102d39f5ae813b2f1334c611fe61f..728eb5729528551b82b950322e5e18c0a9960e33 100644 (file)
@@ -201,3 +201,9 @@ let builtin_values =
        ident_failure; ident_not_found; ident_sys_error; ident_end_of_file;
        ident_division_by_zero; ident_sys_blocked_io;
        ident_assert_failure; ident_undefined_recursive_module ]
+
+(* Start non-predef identifiers at 1000.  This way, more predefs can
+   be defined in this file (above!) without breaking .cmi
+   compatibility. *)
+
+let _ = Ident.set_current_time 999 
index 2134afb568206095488ffcbf41cef5e6ad40dd28..03c5e9110cc0d4a038a33fbe359b7c39d0dfa246 100644 (file)
@@ -33,7 +33,17 @@ let rec longident ppf = function
 
 (* Print an identifier *)
 
-let ident ppf id = fprintf ppf "%s" (Ident.name id)
+let unique_names = ref Ident.empty
+
+let ident_name id =
+  try Ident.find_same id !unique_names with Not_found -> Ident.name id
+
+let add_unique id =
+  try ignore (Ident.find_same id !unique_names)
+  with Not_found ->
+    unique_names := Ident.add id (Ident.unique_toplevel_name id) !unique_names
+
+let ident ppf id = fprintf ppf "%s" (ident_name id)
 
 (* Print a path *)
 
@@ -41,7 +51,7 @@ let ident_pervasive = Ident.create_persistent "Pervasives"
 
 let rec tree_of_path = function
   | Pident id ->
-      Oide_ident (Ident.name id)
+      Oide_ident (ident_name id)
   | Pdot(Pident id, s, pos) when Ident.same id ident_pervasive ->
       Oide_ident s
   | Pdot(p, s, pos) ->
@@ -288,7 +298,7 @@ let reset_loop_marks () =
   visited_objects := []; aliased := []; delayed := []
 
 let reset () =
-  reset_names (); reset_loop_marks ()
+  unique_names := Ident.empty; reset_names (); reset_loop_marks ()
 
 let reset_and_mark_loops ty =
   reset (); mark_loops ty
@@ -539,11 +549,8 @@ let rec tree_of_type_decl id decl =
     let abstr =
       match decl.type_kind with
         Type_abstract ->
-          begin match decl.type_manifest with
-            None -> true
-          | Some ty -> has_constr_row ty
-          end
-      | Type_variant _ | Type_record(_,_) ->
+          decl.type_manifest = None || decl.type_private = Private
+      | Type_variant _ | Type_record _ ->
           decl.type_private = Private
     in
     let vari =
@@ -963,8 +970,32 @@ let explanation unif mis ppf =
     None -> ()
   | Some (t3, t4) -> explanation unif t3 t4 ppf
 
+let ident_same_name id1 id2 =
+  if Ident.equal id1 id2 && not (Ident.same id1 id2) then begin
+    add_unique id1; add_unique id2
+  end
+
+let rec path_same_name p1 p2 =
+  match p1, p2 with
+    Pident id1, Pident id2 -> ident_same_name id1 id2
+  | Pdot (p1, s1, _), Pdot (p2, s2, _) when s1 = s2 -> path_same_name p1 p2
+  | Papply (p1, p1'), Papply (p2, p2') ->
+      path_same_name p1 p2; path_same_name p1' p2'
+  | _ -> ()
+
+let type_same_name t1 t2 =
+  match (repr t1).desc, (repr t2).desc with
+    Tconstr (p1, _, _), Tconstr (p2, _, _) -> path_same_name p1 p2
+  | _ -> ()
+
+let rec trace_same_names = function
+    (t1, t1') :: (t2, t2') :: rem ->
+      type_same_name t1 t2; type_same_name t1' t2'; trace_same_names rem
+  | _ -> ()
+
 let unification_error unif tr txt1 ppf txt2 =
   reset ();
+  trace_same_names tr;
   let tr = List.map (fun (t, t') -> (t, hide_variant_name t')) tr in
   let mis = mismatch unif tr in
   match tr with
@@ -996,6 +1027,7 @@ let report_unification_error ppf tr txt1 txt2 =
 
 let trace fst txt ppf tr =
   print_labels := not !Clflags.classic;
+  trace_same_names tr;
   try match tr with
     t1 :: t2 :: tr' ->
       if fst then trace fst txt ppf (t1 :: t2 :: filter_trace tr')
index 971d8b295c54d93fae71969068a8b58a31f7ded4..6aa27660611882d7644a3413ecc5c3bc531dcbe6 100644 (file)
@@ -309,11 +309,17 @@ and modtype_declaration s = function
     Tmodtype_abstract -> Tmodtype_abstract
   | Tmodtype_manifest mty -> Tmodtype_manifest(modtype s mty)
 
+(* For every binding k |-> d of m1, add k |-> f d to m2 
+   and return resulting merged map. *)
+
+let merge_tbls f m1 m2 =
+  Tbl.fold (fun k d accu -> Tbl.add k (f d) accu) m1 m2
+
 (* Composition of substitutions:
      apply (compose s1 s2) x = apply s2 (apply s1 x) *)
 
 let compose s1 s2 =
-  { types = Tbl.map (fun id p -> type_path s2 p) s1.types;
-    modules = Tbl.map (fun id p -> module_path s2 p) s1.modules;
-    modtypes = Tbl.map (fun id mty -> modtype s2 mty) s1.modtypes;
+  { types = merge_tbls (type_path s2) s1.types s2.types;
+    modules = merge_tbls (module_path s2) s1.modules s2.modules;
+    modtypes = merge_tbls (modtype s2) s1.modtypes s2.modtypes;
     for_saving = false }
index 013275ca0cdda040ba1cc2a5d11c7ccf2575d473..142f22cb450e9f547f9e762d46747a2fd8acebef 100644 (file)
@@ -774,12 +774,13 @@ and class_expr cl_num val_env met_env scl =
       let loc = default.pexp_loc in
       let scases =
         [{ppat_loc = loc; ppat_desc =
-          Ppat_construct(Longident.Lident"Some",
+          Ppat_construct(Longident.(Ldot (Lident"*predef*", "Some")),
                          Some{ppat_loc = loc; ppat_desc = Ppat_var"*sth*"},
                          false)},
          {pexp_loc = loc; pexp_desc = Pexp_ident(Longident.Lident"*sth*")};
          {ppat_loc = loc; ppat_desc =
-          Ppat_construct(Longident.Lident"None", None, false)},
+          Ppat_construct(Longident.(Ldot (Lident"*predef*", "None")),
+                         None, false)},
          default] in
       let smatch =
         {pexp_loc = loc; pexp_desc =
index fb91522698946aad74502ad246fb7cb8ce27a75c..0f55bbab66e48d22ac9b58615e554f0a4cb7dc21 100644 (file)
@@ -49,7 +49,7 @@ type error =
   | Private_type of type_expr
   | Private_label of Longident.t * type_expr
   | Unbound_instance_variable of string
-  | Instance_variable_not_mutable of string
+  | Instance_variable_not_mutable of bool * string
   | Not_subtype of (type_expr * type_expr) list * (type_expr * type_expr) list
   | Outside_class
   | Value_multiply_overridden of string
@@ -305,11 +305,74 @@ let rec build_as_type env p =
   | Tpat_any | Tpat_var _ | Tpat_constant _
   | Tpat_array _ | Tpat_lazy _ -> p.pat_type
 
+(* Narrowing unbound identifier errors. *)
+let rec narrow_unbound_lid_error env lid make_error =
+  let module_is_bound mlid =
+    ignore (Env.lookup_module mlid env) in
+  match lid with
+  | Longident.Lident _ -> make_error lid
+  | Longident.Ldot (mlid, _) ->
+    begin
+      try
+        module_is_bound mlid;
+        make_error lid with
+      | Not_found -> Unbound_module mlid
+    end
+  | Longident.Lapply (flid, mlid) ->
+    begin
+      try
+        module_is_bound flid;
+        begin
+          try
+            module_is_bound mlid;
+            make_error lid with
+          | Not_found -> Unbound_module mlid
+        end with
+      | Not_found -> Unbound_functor flid
+    end
+;;
+
+let unbound_lid_error env loc lid make_error =
+  let err = narrow_unbound_lid_error env lid make_error in
+  raise (Error (loc, err))
+;;
+
+let find_type env loc lid =
+  try Env.lookup_type lid env
+  with Not_found ->
+    unbound_lid_error env loc lid
+      (fun lid ->
+       raise (Typetexp.Error (loc, Typetexp.Unbound_type_constructor lid)))
+;;
+
+let find_constructor env loc lid =
+  try
+    match lid with
+    | Longident.Ldot (Longident.Lident "*predef*", s) ->
+        Env.lookup_constructor (Longident.Lident s) Env.initial
+    | _ -> Env.lookup_constructor lid env
+  with Not_found ->
+    unbound_lid_error env loc lid
+      (fun lid -> Unbound_constructor lid)
+;;
+
+let find_label env loc lid =
+  try
+    Env.lookup_label lid env
+  with Not_found ->
+    unbound_lid_error env loc lid
+      (fun lid -> Unbound_label lid)
+;;
+
+let find_class env loc lid =
+  try Env.lookup_class lid env with
+  | Not_found ->
+      unbound_lid_error env loc lid
+        (fun lid -> Unbound_class lid)
+;;
+
 let build_or_pat env loc lid =
-  let path, decl =
-    try Env.lookup_type lid env
-    with Not_found ->
-      raise(Typetexp.Error(loc, Typetexp.Unbound_type_constructor lid))
+  let path, decl = find_type env loc lid
   in
   let tyl = List.map (fun _ -> newvar()) decl.type_params in
   let row0 =
@@ -461,11 +524,7 @@ let rec type_pat env sp =
         pat_type = newty (Ttuple(List.map (fun p -> p.pat_type) pl));
         pat_env = env }
   | Ppat_construct(lid, sarg, explicit_arity) ->
-      let constr =
-        try
-          Env.lookup_constructor lid env
-        with Not_found ->
-          raise(Error(loc, Unbound_constructor lid)) in
+      let constr = find_constructor env loc lid in
       let sargs =
         match sarg with
           None -> []
@@ -506,11 +565,7 @@ let rec type_pat env sp =
   | Ppat_record(lid_sp_list, closed) ->
       let ty = newvar() in
       let type_label_pat (lid, sarg) =
-        let label =
-          try
-            Env.lookup_label lid env
-          with Not_found ->
-            raise(Error(loc, Unbound_label lid)) in
+        let label = find_label env loc lid in
         begin_def ();
         let (vars, ty_arg, ty_res) = instance_label false label in
         if vars = [] then end_def ();
@@ -1015,37 +1070,6 @@ let unify_exp env exp expected_ty =
   | Tags(l1,l2) ->
       raise(Typetexp.Error(exp.exp_loc, Typetexp.Variant_tags (l1, l2)))
 
-let rec narrow_unbound_lid_error env make_error lid =
-  let module_is_bound mlid =
-    ignore (Env.lookup_module mlid env) in
-  match lid with
-  | Longident.Lident _ -> make_error lid
-  | Longident.Ldot (mlid, _) ->
-    begin
-      try
-        module_is_bound mlid;
-        make_error lid with
-      | Not_found -> Unbound_module mlid
-    end
-  | Longident.Lapply (flid, mlid) ->
-    begin
-      try
-        module_is_bound flid;
-        begin
-          try
-            module_is_bound mlid;
-            make_error lid with
-          | Not_found -> Unbound_module mlid
-        end with
-      | Not_found -> Unbound_functor flid
-    end
-;;
-
-let unbound_ident_error loc env make_error lid =
-  let err = narrow_unbound_lid_error env make_error lid in
-  raise (Error (loc, err))
-;;
-
 let rec type_exp env sexp =
   let loc = sexp.pexp_loc in
   match sexp.pexp_desc with
@@ -1080,7 +1104,8 @@ let rec type_exp env sexp =
           exp_type = instance desc.val_type;
           exp_env = env }
       with Not_found ->
-        unbound_ident_error loc env (fun lid -> Unbound_value lid) lid
+        unbound_lid_error env loc lid
+          (fun lid -> Unbound_value lid)
       end
   | Pexp_constant cst ->
       re {
@@ -1180,11 +1205,7 @@ let rec type_exp env sexp =
       let ty = newvar() in
       let num_fields = ref 0 in
       let type_label_exp (lid, sarg) =
-        let label =
-          try
-            Env.lookup_label lid env
-          with Not_found ->
-            raise(Error(loc, Unbound_label lid)) in
+        let label = find_label env loc lid in
         begin_def ();
         if !Clflags.principal then begin_def ();
         let (vars, ty_arg, ty_res) = instance_label true label in
@@ -1255,11 +1276,7 @@ let rec type_exp env sexp =
         exp_env = env }
   | Pexp_field(sarg, lid) ->
       let arg = type_exp env sarg in
-      let label =
-        try
-          Env.lookup_label lid env
-        with Not_found ->
-          raise(Error(loc, Unbound_label lid)) in
+      let label = find_label env loc lid in
       let (_, ty_arg, ty_res) = instance_label false label in
       unify_exp env arg ty_res;
       re {
@@ -1269,11 +1286,7 @@ let rec type_exp env sexp =
         exp_env = env }
   | Pexp_setfield(srecord, lid, snewval) ->
       let record = type_exp env srecord in
-      let label =
-        try
-          Env.lookup_label lid env
-        with Not_found ->
-          raise(Error(loc, Unbound_label lid)) in
+      let label = find_label env loc lid in
       if label.lbl_mut = Immutable then
         raise(Error(loc, Label_not_mutable lid));
       begin_def ();
@@ -1520,10 +1533,7 @@ let rec type_exp env sexp =
         raise(Error(e.pexp_loc, Undefined_method (obj.exp_type, met)))
       end
   | Pexp_new cl ->
-      let (cl_path, cl_decl) =
-        try Env.lookup_class cl env with Not_found ->
-          raise(Error(loc, Unbound_class cl))
-      in
+      let (cl_path, cl_decl) = find_class env loc cl in
         begin match cl_decl.cty_new with
           None ->
             raise(Error(loc, Virtual_class cl))
@@ -1549,9 +1559,9 @@ let rec type_exp env sexp =
               exp_type = instance Predef.type_unit;
               exp_env = env }
         | Val_ivar _ ->
-            raise(Error(loc, Instance_variable_not_mutable lab))
+            raise(Error(loc,Instance_variable_not_mutable(true,lab)))
         | _ ->
-            raise(Error(loc, Unbound_instance_variable lab))
+            raise(Error(loc,Instance_variable_not_mutable(false,lab)))
       with
         Not_found ->
           raise(Error(loc, Unbound_instance_variable lab))
@@ -1942,11 +1952,7 @@ and type_application env funct sargs =
         type_args [] [] ty ty sargs []
 
 and type_construct env loc lid sarg explicit_arity ty_expected =
-  let constr =
-    try
-      Env.lookup_constructor lid env
-    with Not_found ->
-      raise(Error(loc, Unbound_constructor lid)) in
+  let constr = find_constructor env loc lid in
   let sargs =
     match sarg with
       None -> []
@@ -2020,13 +2026,14 @@ and type_expect ?in_function env sexp ty_expected =
          {ppat_loc = default_loc;
           ppat_desc =
             Ppat_construct
-              (Longident.Lident "Some",
+              (Longident.(Ldot (Lident "*predef*", "Some")),
                Some {ppat_loc = default_loc; ppat_desc = Ppat_var "*sth*"},
                false)},
          {pexp_loc = default_loc;
           pexp_desc = Pexp_ident(Longident.Lident "*sth*")};
          {ppat_loc = default_loc;
-          ppat_desc = Ppat_construct(Longident.Lident "None", None, false)},
+          ppat_desc = Ppat_construct
+            (Longident.(Ldot (Lident "*predef*", "None")), None, false)},
          default;
       ] in
       let smatch = {
@@ -2393,8 +2400,11 @@ let report_error ppf = function
         longident cl
   | Unbound_instance_variable v ->
       fprintf ppf "Unbound instance variable %s" v
-  | Instance_variable_not_mutable v ->
-      fprintf ppf "The instance variable %s is not mutable" v
+  | Instance_variable_not_mutable (b, v) ->
+      if b then
+        fprintf ppf "The instance variable %s is not mutable" v
+      else
+        fprintf ppf "The value %s is not an instance variable" v
   | Not_subtype(tr1, tr2) ->
       report_subtyping_error ppf tr1 "is not a subtype of" tr2
   | Outside_class ->
index a1a9ecd927eccceb1d118289792f576c13935e1c..11132827fa4f010267296ab8a516af7e46849b68 100644 (file)
@@ -89,7 +89,7 @@ type error =
   | Private_type of type_expr
   | Private_label of Longident.t * type_expr
   | Unbound_instance_variable of string
-  | Instance_variable_not_mutable of string
+  | Instance_variable_not_mutable of bool * string
   | Not_subtype of (type_expr * type_expr) list * (type_expr * type_expr) list
   | Outside_class
   | Value_multiply_overridden of string
index 6ee97aa60ce8f4d4c4268033778b72a88e611050..1d0eaad1de82ca5a4d70ce71f233f7c79e36ca1b 100644 (file)
@@ -599,6 +599,34 @@ let compute_variance_decls env cldecls =
        {cltydef with clty_variance = variance}))
     decls cldecls
 
+(* Check multiple declarations of labels/constructors *)
+
+let check_duplicates name_sdecl_list =
+  let labels = Hashtbl.create 7 and constrs = Hashtbl.create 7 in
+  List.iter
+    (fun (name, sdecl) -> match sdecl.ptype_kind with
+      Ptype_variant cl ->
+        List.iter
+          (fun (cname, _, loc) ->
+            try
+              let name' = Hashtbl.find constrs cname in
+              Location.prerr_warning loc
+                (Warnings.Duplicate_definitions
+                   ("constructor", cname, name', name))
+            with Not_found -> Hashtbl.add constrs cname name)
+          cl
+    | Ptype_record fl ->
+        List.iter
+          (fun (cname, _, _, loc) ->
+            try
+              let name' = Hashtbl.find labels cname in
+              Location.prerr_warning loc
+                (Warnings.Duplicate_definitions ("label", cname, name', name))
+            with Not_found -> Hashtbl.add labels cname name)
+          fl
+    | Ptype_abstract -> ())
+    name_sdecl_list
+
 (* Force recursion to go through id for private types*)
 let name_recursion sdecl id decl =
   match decl with
@@ -645,6 +673,8 @@ let transl_type_decl env name_sdecl_list =
   (* Translate each declaration. *)
   let decls =
     List.map2 (transl_declaration temp_env) name_sdecl_list id_list in
+  (* Check for duplicates *)
+  check_duplicates name_sdecl_list;
   (* Build the final env. *)
   let newenv =
     List.fold_right
index 000131edef54822d817efb4c88c3f27c3da6430e..dbe61f42ead6935ba68870506573ca831009d91b 100644 (file)
@@ -899,21 +899,6 @@ and type_structure funct_body anchor env sstr scope =
 let type_module = type_module false None
 let type_structure = type_structure false None
 
-let type_module_type_of env smod =
-  match smod.pmod_desc with
-  | Pmod_ident lid -> (* turn off strengthening in this case *)
-      let (path, mty) = type_module_path env smod.pmod_loc lid in mty
-  | _ ->
-      (type_module env smod).mod_type
-
-(* Fill in the forward declarations *)
-let () =
-  Typecore.type_module := type_module;
-  Typetexp.transl_modtype_longident := transl_modtype_longident;
-  Typetexp.transl_modtype := transl_modtype;
-  Typecore.type_open := type_open;
-  type_module_type_of_fwd := type_module_type_of
-
 (* Normalize types in a signature *)
 
 let rec normalize_modtype env = function
@@ -960,6 +945,29 @@ and simplify_signature sg =
   in
     simplif StringSet.empty StringSet.empty [] (List.rev sg)
 
+(* Extract the module type of a module expression *)
+
+let type_module_type_of env smod =
+  let mty =
+    match smod.pmod_desc with
+    | Pmod_ident lid -> (* turn off strengthening in this case *)
+        let (path, mty) = type_module_path env smod.pmod_loc lid in mty
+    | _ -> (type_module env smod).mod_type in
+  (* PR#5037: clean up inferred signature to remove duplicate specs *)
+  let mty = simplify_modtype mty in
+  (* PR#5036: must not contain non-generalized type variables *)
+  if not (closed_modtype mty) then
+    raise(Error(smod.pmod_loc, Non_generalizable_module mty));
+  mty
+
+(* Fill in the forward declarations *)
+let () =
+  Typecore.type_module := type_module;
+  Typetexp.transl_modtype_longident := transl_modtype_longident;
+  Typetexp.transl_modtype := transl_modtype;
+  Typecore.type_open := type_open;
+  type_module_type_of_fwd := type_module_type_of
+
 (* Typecheck an implementation file *)
 
 let type_implementation sourcefile outputprefix modulename initial_env ast =
index fbbbdf10b36c1b5f2eb4705383123176247ac3f7..94a29217dc7ae2fd9711b1e017b7b2ef0d4e1218 100644 (file)
@@ -120,8 +120,8 @@ let call_linker mode output_name files extra =
         (if !Clflags.gprofile then Config.cc_profile else "")
         ""  (*(Clflags.std_include_flag "-I")*)
         (quote_prefixed "-L" !Config.load_path)
+        (String.concat " " (List.rev !Clflags.ccopts))
         files
         extra
-        (String.concat " " (List.rev !Clflags.ccopts))
   in
   command cmd = 0
index d6689f088d1a88119757a6f9ac12c35351b8a152..b06516931db56c46d59c893a4faf891e1ad8fa50 100644 (file)
@@ -99,6 +99,12 @@ let rec map f = function
     Empty -> Empty
   | Node(l, v, d, r, h) -> Node(map f l, v, f v d, map f r, h)
 
+let rec fold f m accu =
+  match m with
+  | Empty -> accu
+  | Node(l, v, d, r, _) ->
+      fold f r (f v d (fold f l accu))
+
 open Format
 
 let print print_key print_data ppf tbl =
index 21c89b04fe3c9b62832c264ed7f6ec496c9a9b02..44a021a7855f6e62d596936f18ec866c3d13bfbb 100644 (file)
@@ -24,6 +24,7 @@ val mem: 'a -> ('a, 'b) t -> bool
 val remove: 'a -> ('a,  'b) t -> ('a, 'b) t
 val iter: ('a -> 'b -> unit) -> ('a, 'b) t -> unit
 val map: ('a -> 'b -> 'c) -> ('a, 'b) t -> ('a, 'c) t
+val fold: ('a -> 'b -> 'c -> 'c) -> ('a, 'b) t -> 'c -> 'c
 
 open Format
 
index 8f84369d5047ae1eace431c8155905f623a5b504..fff95d29cc00a96108afc4cf0d05e1d42e92c430 100644 (file)
@@ -49,6 +49,7 @@ type t =
   | Unused_var_strict of string             (* 27 *)
   | Wildcard_arg_to_constant_constr         (* 28 *)
   | Eol_in_string                           (* 29 *)
+  | Duplicate_definitions of string * string * string * string (*30 *)
 ;;
 
 (* If you remove a warning, leave a hole in the numbering.  NEVER change
@@ -87,9 +88,10 @@ let number = function
   | Unused_var_strict _ -> 27
   | Wildcard_arg_to_constant_constr -> 28
   | Eol_in_string -> 29
+  | Duplicate_definitions _ -> 30
 ;;
 
-let last_warning_number = 29;;
+let last_warning_number = 30;;
 (* Must be the max number returned by the [number] function. *)
 
 let letter = function
@@ -118,7 +120,7 @@ let letter = function
   | 'u' -> [11; 12]
   | 'v' -> [13]
   | 'w' -> []
-  | 'x' -> [14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25]
+  | 'x' -> [14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 30]
   | 'y' -> [26]
   | 'z' -> [27]
   | _ -> assert false
@@ -131,15 +133,25 @@ let is_active x = active.(number x);;
 let is_error x = error.(number x);;
 
 let parse_opt flags s =
-  let check i =
-    if i < 1 then raise (Arg.Bad "Bad warning number 0");
-    if i > last_warning_number then
-      raise (Arg.Bad "Bad warning number (too large)");
-  in
   let set i = flags.(i) <- true in
   let clear i = flags.(i) <- false in
   let set_all i = active.(i) <- true; error.(i) <- true in
   let error () = raise (Arg.Bad "Ill-formed list of warnings") in
+  let rec get_num n i =
+    if i >= String.length s then i, n
+    else match s.[i] with
+    | '0'..'9' -> get_num (10 * n + Char.code s.[i] - Char.code '0') (i + 1)
+    | _ -> i, n
+  in
+  let get_range i =
+    let i, n1 = get_num 0 i in
+    if i + 2 < String.length s && s.[i] = '.' && s.[i + 1] = '.' then
+      let i, n2 = get_num 0 (i + 2) in
+      if n2 < n1 then error ();
+      i, n1, n2
+    else
+      i, n1, n1
+  in
   let rec loop i =
     if i >= String.length s then () else
     match s.[i] with
@@ -156,7 +168,10 @@ let parse_opt flags s =
   and loop_letter_num myset i =
     if i >= String.length s then error () else
     match s.[i] with
-    | '0' .. '9' -> loop_num myset i 0
+    | '0' .. '9' ->
+        let i, n1, n2 = get_range i in
+        for n = n1 to min n2 last_warning_number do myset n done;
+        loop i
     | 'A' .. 'Z' ->
        List.iter myset (letter (Char.lowercase s.[i]));
        loop (i+1)
@@ -164,21 +179,14 @@ let parse_opt flags s =
        List.iter myset (letter s.[i]);
        loop (i+1)
     | _ -> error ()
-  and loop_num myset i n =
-    if i >= String.length s then myset n else
-    match s.[i] with
-    | '0' .. '9' ->
-       let nn = 10 * n + Char.code s.[i] - Char.code '0' in
-       check nn;
-       loop_num myset (i+1) nn
-    | _ -> myset n; loop i
   in
   loop 0
 ;;
 
 let parse_options errflag s = parse_opt (if errflag then error else active) s;;
 
-let defaults_w = "+a-4-6-9-27-28-29";;
+(* If you change these, don't forget to change them in man/ocamlc.m *)
+let defaults_w = "+a-4-6-7-9-27..29";;
 let defaults_warn_error = "-a";;
 
 let () = parse_options false defaults_w;;
@@ -249,6 +257,9 @@ let message = function
      "wildcard pattern given as argument to a constant constructor"
   | Eol_in_string ->
      "unescaped end-of-line in a string constant (non-portable code)"
+  | Duplicate_definitions (kind, cname, tc1, tc2) ->
+      Printf.sprintf "the %s %s is defined in both types %s and %s."
+        kind cname tc1 tc2
 ;;
 
 let nerrors = ref 0;;
@@ -281,3 +292,51 @@ let check_fatal () =
     raise e;
   end;
 ;;
+
+
+let descriptions =
+  [
+    1, "Suspicious-looking start-of-comment mark.";
+    2, "Suspicious-looking end-of-comment mark.";
+    3, "Deprecated syntax.";
+    4, "Fragile pattern matching: matching that will remain complete even\n\
+   \    if additional constructors are added to one of the variant types\n\
+   \    matched.";
+    5, "Partially applied function: expression whose result has function\n\
+   \    type and is ignored.";
+    6, "Label omitted in function application.";
+    7, "Some methods are overriden in the class where they are defined.";
+    8, "Partial match: missing cases in pattern-matching.";
+    9, "Missing fields in a record pattern.";
+   10, "Expression on the left-hand side of a sequence that doesn't have type\n\
+   \    \"unit\" (and that is not a function, see warning number 5).";
+   11, "Redundant case in a pattern matching (unused match case).";
+   12, "Redundant sub-pattern in a pattern-matching.";
+   13, "Override of an instance variable.";
+   14, "Illegal backslash escape in a string constant.";
+   15, "Private method made public implicitly.";
+   16, "Unerasable optional argument.";
+   17, "Undeclared virtual method.";
+   18, "Non-principal type.";
+   19, "Type without principality.";
+   20, "Unused function argument.";
+   21, "Non-returning statement.";
+   22, "Camlp4 warning.";
+   23, "Useless record \"with\" clause.";
+   24, "Bad module name: the source file name is not a valid OCaml module name.";
+   25, "Pattern-matching with all clauses guarded.  Exhaustiveness cannot be\n\
+   \    checked";
+   26, "Suspicious unused variable: unused variable that is bound with \"let\"\n\
+   \    or \"as\", and doesn't start with an underscore (\"_\") character.";
+   27, "Innocuous unused variable: unused variable that is not bound with\n\
+   \    \"let\" nor \"as\", and doesn't start with an underscore (\"_\")\n\
+   \    character.";
+   28, "Wildcard pattern given as argument to a constant constructor.";
+   29, "Unescaped end-of-line in a string constant (non-portable code).";
+   30, "Two labels or constructors of the same name are defined in two\n\
+   \    mutually recursive types.";
+  ]
+
+let help_warnings () =
+  List.iter (fun (i, s) -> Printf.printf "%3i %s\n" i s) descriptions;
+  exit 0
index 0664788ed6442859251b439284577ec881c48192..c9e577d9f397d26e71f7a629e45189b8f2362eb1 100644 (file)
@@ -44,6 +44,7 @@ type t =
   | Unused_var_strict of string             (* 27 *)
   | Wildcard_arg_to_constant_constr         (* 28 *)
   | Eol_in_string                           (* 29 *)
+  | Duplicate_definitions of string * string * string * string (*30 *)
 ;;
 
 val parse_options : bool -> string -> unit;;
@@ -61,3 +62,5 @@ val print : formatter -> t -> int;;
 exception Errors of int;;
 
 val check_fatal : unit -> unit;;
+
+val help_warnings: unit -> unit