From: Kate <kit-ty-kate@outlook.com>
Date: Tue, 7 Jan 2025 15:36:30 +0000
Subject: Add support for OCaml 5.3

Bug-Debian: https://bugs.debian.org/1093101
Origin: https://github.com/ocsigen/eliom/pull/813
---
 src/ppx/ppx_eliom_utils.ml | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/ppx/ppx_eliom_utils.ml b/src/ppx/ppx_eliom_utils.ml
index c5df7d6..ac7c7e7 100644
--- a/src/ppx/ppx_eliom_utils.ml
+++ b/src/ppx/ppx_eliom_utils.ml
@@ -453,9 +453,18 @@ module Cmo = struct
     in
     type_of_out_type ty
 
+  [%%if ocaml_version >= (5, 3, 0)]
+  let typ ty =
+    let ty =
+      Out_type.prepare_for_printing [ty];
+      Out_type.tree_of_typexp Type_scheme ty
+    in
+    type_of_out_type ty
+  [%%else]
   let typ ty =
     let ty = Printtyp.tree_of_type_scheme ty in
     type_of_out_type ty
+  [%%endif]
 
   let find err loc =
     let {Lexing.pos_fname; pos_cnum; _} = loc.Location.loc_start in
