Merge pull request #377 from dra27/lib-layout

Support new Load_path.init API
This commit is contained in:
Kate 2022-06-15 16:18:46 +01:00 committed by GitHub
commit ecda59a261
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View File

@ -854,11 +854,16 @@ let () =
+-----------------------------------------------------------------+ *)
#if OCAML_VERSION >= (4, 08, 0)
let get_load_path ()= Load_path.get_paths ()
let set_load_path path= Load_path.init path
let get_load_path () = Load_path.get_paths ()
#if OCAML_VERSION >= (5, 0, 0)
let set_load_path path =
Load_path.init path ~auto_include:Load_path.no_auto_include
#else
let get_load_path ()= !Config.load_path
let set_load_path path= Config.load_path := path
let set_load_path path = Load_path.init path
#endif
#else
let get_load_path () = !Config.load_path
let set_load_path path = Config.load_path := path
#endif
(* +-----------------------------------------------------------------+

View File

@ -1371,7 +1371,11 @@ let emacs_mode = ref false
let preload = ref []
let prepare () =
#if OCAML_VERSION >= (5, 0, 0)
Toploop.set_paths ~auto_include:Load_path.no_auto_include ();
#else
Toploop.set_paths ();
#endif
try
let ok =
List.for_all