Support new Load_path.init API

This commit is contained in:
David Allsopp 2022-06-06 15:20:37 +01:00
parent 42614160c2
commit fbbaec6be8
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