diff options
| author | ppedrot | 2013-03-21 14:22:36 +0000 |
|---|---|---|
| committer | ppedrot | 2013-03-21 14:22:36 +0000 |
| commit | f43d96aec71449e3b75e9fd732e87694cec5db8f (patch) | |
| tree | 593eff77bb330585bc5b604d3f7aba186204d55d /library | |
| parent | 7f3a79cd9426b009021e2096805f94c5641988da (diff) | |
Removing mandatory suffixes for library files.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16332 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'library')
| -rw-r--r-- | library/library.ml | 6 | ||||
| -rw-r--r-- | library/states.ml | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/library/library.ml b/library/library.ml index a5f93c02c1..edb86bc4c3 100644 --- a/library/library.ml +++ b/library/library.ml @@ -318,7 +318,7 @@ let in_import : DirPath.t * bool -> obj = (*s Loading from disk to cache (preparation phase) *) let (raw_extern_library, raw_intern_library) = - System.raw_extern_intern Coq_config.vo_magic_number ".vo" + System.raw_extern_intern Coq_config.vo_magic_number (************************************************************************) (*s Locate absolute or partially qualified library names in the path *) @@ -401,10 +401,10 @@ let mk_library md table digest = let fetch_opaque_table (f,pos,digest) = try let ch = System.with_magic_number_check raw_intern_library f in - seek_in ch pos; + let () = seek_in ch pos in if not (String.equal (System.marshal_in f ch) digest) then failwith "File changed!"; let table = (System.marshal_in f ch : LightenLibrary.table) in - close_in ch; + let () = close_in ch in table with e when Errors.noncritical e -> error diff --git a/library/states.ml b/library/states.ml index f30633171d..906ebdacc3 100644 --- a/library/states.ml +++ b/library/states.ml @@ -18,13 +18,16 @@ let unfreeze (fl,fs) = Summary.unfreeze_summaries fs let (extern_state,intern_state) = + let ensure_suffix f = CUnix.make_suffix f ".coq" in let (raw_extern, raw_intern) = - extern_intern Coq_config.state_magic_number ".coq" in + extern_intern Coq_config.state_magic_number in (fun s -> + let s = ensure_suffix s in if !Flags.load_proofs <> Flags.Force then Errors.error "Write State only works with option -force-load-proofs"; raw_extern s (freeze())), (fun s -> + let s = ensure_suffix s in unfreeze (with_magic_number_check (raw_intern (Library.get_load_paths ())) s); Library.overwrite_library_filenames s) |
