build: Update non-gettext path for OCaml format type changes
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 28 Feb 2025 11:20:37 +0000 (11:20 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Fri, 28 Feb 2025 11:20:37 +0000 (11:20 +0000)
For printf and similar functions, OCaml now uses format6 instead of
the old 4-argument format types.

I'm not sure which OCaml version this change was introduced in, but
this should work back to at least OCaml 4.05 (RHEL 7), and probably
earlier.

configure.ac

index 840eba2..e8df03c 100644 (file)
@@ -146,12 +146,14 @@ else
     cat <<EOT >>src/opt_gettext.ml
 module Gettext = struct
   external s_ : string -> string = "%identity"
-  external f_ : ('a -> 'b, 'c, 'd) format -> ('a -> 'b, 'c, 'd) format
+  external f_ : ('a, 'b, 'c, 'd, 'e, 'f) format6
+    -> ('a, 'b, 'c, 'd, 'e, 'f) format6
     = "%identity"
   let sn_ : string -> string -> int -> string
     = fun s p n -> if n = 1 then s else p
-  let fn_ : ('a -> 'b, 'c, 'd) format -> ('a -> 'b, 'c, 'd) format -> int
-      -> ('a -> 'b, 'c, 'd) format
+  let fn_ : ('a, 'b, 'c, 'd, 'e, 'f) format6
+    -> ('a, 'b, 'c, 'd, 'e, 'f) format6
+    -> int -> ('a, 'b, 'c, 'd, 'e, 'f) format6
     = fun s p n -> if n = 1 then s else p
 end
 EOT