Skip to content

Commit

Permalink
Support new Load_path.init API
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed Jun 9, 2022
1 parent 4261416 commit fbbaec6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/lib/uTop.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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

(* +-----------------------------------------------------------------+
Expand Down
4 changes: 4 additions & 0 deletions src/lib/uTop_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fbbaec6

Please sign in to comment.