Skip to content

Commit ecda59a

Browse files
authored
Merge pull request #377 from dra27/lib-layout
Support new Load_path.init API
2 parents 4261416 + fbbaec6 commit ecda59a

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/lib/uTop.ml

+9-4
Original file line numberDiff line numberDiff line change
@@ -854,11 +854,16 @@ let () =
854854
+-----------------------------------------------------------------+ *)
855855

856856
#if OCAML_VERSION >= (4, 08, 0)
857-
let get_load_path ()= Load_path.get_paths ()
858-
let set_load_path path= Load_path.init path
857+
let get_load_path () = Load_path.get_paths ()
858+
#if OCAML_VERSION >= (5, 0, 0)
859+
let set_load_path path =
860+
Load_path.init path ~auto_include:Load_path.no_auto_include
859861
#else
860-
let get_load_path ()= !Config.load_path
861-
let set_load_path path= Config.load_path := path
862+
let set_load_path path = Load_path.init path
863+
#endif
864+
#else
865+
let get_load_path () = !Config.load_path
866+
let set_load_path path = Config.load_path := path
862867
#endif
863868

864869
(* +-----------------------------------------------------------------+

src/lib/uTop_main.ml

+4
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,11 @@ let emacs_mode = ref false
13711371
let preload = ref []
13721372

13731373
let prepare () =
1374+
#if OCAML_VERSION >= (5, 0, 0)
1375+
Toploop.set_paths ~auto_include:Load_path.no_auto_include ();
1376+
#else
13741377
Toploop.set_paths ();
1378+
#endif
13751379
try
13761380
let ok =
13771381
List.for_all

0 commit comments

Comments
 (0)