aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorherbelin2004-07-17 13:26:02 +0000
committerherbelin2004-07-17 13:26:02 +0000
commit5eb4ec77dbcc7f4fdbc342db67eeefd93af26d81 (patch)
tree8156aadcb88c034e6dabd25f8a0f2d88c06ad3db
parente80e6ca53b0ea97bcc41efc1757c557e8a5344e6 (diff)
Backtrack sur l'utilisation de pa_macro car n'existait pas en 3.06
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@5941 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--Makefile2
-rw-r--r--lib/compat.ml433
-rw-r--r--toplevel/mltop.ml44
3 files changed, 35 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index c74cf5eedd..c046560174 100644
--- a/Makefile
+++ b/Makefile
@@ -84,7 +84,7 @@ DEPFLAGS=$(LOCALINCLUDES)
OCAMLC_P4O=$(OCAMLC) -pp $(CAMLP4O) $(BYTEFLAGS)
OCAMLOPT_P4O=$(OCAMLOPT) -pp $(CAMLP4O) $(OPTFLAGS)
-CAMLP4EXTENDFLAGS=-I . pa_extend.cmo pa_extend_m.cmo pa_macro.cmo q_MLast.cmo
+CAMLP4EXTENDFLAGS=-I . pa_extend.cmo pa_extend_m.cmo pa_ifdef.cmo q_MLast.cmo
CAMLP4DEPS=sed -n -e 's|^(\*.*camlp4deps: "\(.*\)".*\*)$$|\1|p'
COQINCLUDES= # coqtop includes itself the needed paths
diff --git a/lib/compat.ml4 b/lib/compat.ml4
index 57c7915e30..5e1c65b438 100644
--- a/lib/compat.ml4
+++ b/lib/compat.ml4
@@ -1 +1,32 @@
-type loc = int * int let dummy_loc = 0, 0 let unloc x = x let make_loc x = x
+(************************************************************************)
+(* v * The Coq Proof Assistant / The Coq Development Team *)
+(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(************************************************************************)
+
+(* Compatibility file depending on ocaml version *)
+
+(* IFDEF not available in 3.06; use ifdef instead *)
+
+(* type loc is different in 3.08 *)
+ifdef OCAML308 then
+module M = struct
+type loc = Token.flocation
+let dummy_loc = Token.dummy_loc
+let unloc (b,e) = (b.Lexing.pos_cnum,e.Lexing.pos_cnum)
+let make_loc loc = Token.make_loc loc
+end
+else
+module M = struct
+type loc = int * int
+let dummy_loc = (0,0)
+let unloc x = x
+let make_loc x = x
+end
+
+type loc = M.loc
+let dummy_loc = M.dummy_loc
+let unloc = M.unloc
+let make_loc = M.make_loc
diff --git a/toplevel/mltop.ml4 b/toplevel/mltop.ml4
index 52f2436100..8562038c5e 100644
--- a/toplevel/mltop.ml4
+++ b/toplevel/mltop.ml4
@@ -99,7 +99,7 @@ let dir_ml_load s =
str s; str" to Coq code." >])
(* TO DO: .cma loading without toplevel *)
| WithoutTop ->
- IFDEF Byte THEN
+ ifdef Byte then
let _,gname = where_in_path !coq_mlpath_copy s in
try
Dynlink.loadfile gname;
@@ -109,7 +109,7 @@ let dir_ml_load s =
[Filename.dirname gname]
with | Dynlink.Error a ->
errorlabstrm "Mltop.load_object" [< str (Dynlink.error_message a) >]
- ELSE () END
+ else ()
| Native ->
errorlabstrm "Mltop.no_load_object"
[< str"Loading of ML object file forbidden in a native Coq" >]