Skip to content

Commit cfedb20

Browse files
Fix redirection for older and newer versions
`use_output` was added in 4.11, whereas the `use_trace` was removed in 4.13.
1 parent 19095a9 commit cfedb20

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/top/compat_top.ml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,15 @@ let patch_directive name directive =
191191

192192
let mdx_load = patch_directive "load" (Directive_string (Topdirs.dir_load std_err))
193193
let mdx_use = patch_directive "use" (Directive_string (Topdirs.dir_use std_err))
194-
let mdx_use_output = patch_directive "use_output" (Directive_string (Topdirs.dir_use_output std_err))
195194
let mdx_install_printer = patch_directive "install_printer" (Directive_ident (Topdirs.dir_install_printer std_err))
196195
let mdx_remove_printer = patch_directive "remove_printer" (Directive_ident (Topdirs.dir_remove_printer std_err))
196+
#endif
197+
198+
#if OCAML_VERSION > (4, 11, 0) && OCAML_VERSION < (4, 14, 0)
199+
let mdx_use_output = patch_directive "use_output" (Directive_string (Topdirs.dir_use_output std_err))
200+
#endif
201+
202+
#if OCAML_VERSION < (4, 13, 0)
197203
let mdx_trace = patch_directive "trace" (Directive_ident (Topdirs.dir_trace std_err))
198204
let mdx_untrace = patch_directive "untrace" (Directive_ident (Topdirs.dir_untrace std_err))
199205
let mdx_untrace_all = patch_directive "untrace_all" (Directive_none (Topdirs.dir_untrace_all std_err))
@@ -204,9 +210,13 @@ let redirect_directive directive =
204210
#if OCAML_VERSION < (4, 14, 0)
205211
| "load" -> mdx_load
206212
| "use" -> mdx_use
207-
| "use_output" -> mdx_use_output
208213
| "install_printer" -> mdx_install_printer
209214
| "remove_printer" -> mdx_remove_printer
215+
#endif
216+
#if OCAML_VERSION > (4, 11, 0) && OCAML_VERSION < (4, 14, 0)
217+
| "use_output" -> mdx_use_output
218+
#endif
219+
#if OCAML_VERSION < (4, 13, 0)
210220
| "trace" -> mdx_trace
211221
| "untrace" -> mdx_untrace
212222
| "untrace_all" -> mdx_untrace_all

0 commit comments

Comments
 (0)