summaryrefslogtreecommitdiff
path: root/exportclight
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-04-08 17:36:13 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-04-08 17:36:13 +0000
commited4dc23a50557da6eecbc29ce4cd116e35f3de6e (patch)
tree206f878c15ddc9c14067cbf05b3d05df6b4af522 /exportclight
parent7f989404e3a13a51f962827b425976b1853a99a2 (diff)
List.iteri not in OCaml < 4.00, better not use it.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2182 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'exportclight')
-rw-r--r--exportclight/ExportClight.ml11
1 files changed, 9 insertions, 2 deletions
diff --git a/exportclight/ExportClight.ml b/exportclight/ExportClight.ml
index 1a8afa4..ef00512 100644
--- a/exportclight/ExportClight.ml
+++ b/exportclight/ExportClight.ml
@@ -449,6 +449,13 @@ let re_annot_param = Str.regexp "%%\\|%[1-9][0-9]*"
type fragment = Text of string | Param of int
+(* For compatibility with OCaml < 4.00 *)
+let list_iteri f l =
+ let rec iteri i = function
+ | [] -> ()
+ | a::l -> f i a; iteri (i + 1) l
+ in iteri 0 l
+
let print_assertion p (txt, targs) =
let frags =
List.map
@@ -464,14 +471,14 @@ let print_assertion p (txt, targs) =
| Param n -> max_param := max n !max_param)
frags;
fprintf p " | %ld%%positive, " (P.to_int32 txt);
- List.iteri
+ list_iteri
(fun i targ ->
match targ with
| AA_arg _ -> fprintf p "_x%d :: " (i + 1)
| _ -> ())
targs;
fprintf p "nil =>@ ";
- List.iteri
+ list_iteri
(fun i targ ->
match targ with
| AA_arg _ -> ()