From c3698637e23ca9396bf1e924be07692701735411 Mon Sep 17 00:00:00 2001
From: Keri Harris <keri@gentoo.org>
Date: Sat, 21 May 2022 10:12:23 +0200
Subject: dev-lang/cxprolog: printf fixes for MUSL

Closes: https://bugs.gentoo.org/834101
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Keri Harris <keri@gentoo.org>
---
 dev-lang/cxprolog/cxprolog-0.98.2.ebuild                  |  1 +
 dev-lang/cxprolog/files/cxprolog-0.98.2-printf-musl.patch | 14 ++++++++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 dev-lang/cxprolog/files/cxprolog-0.98.2-printf-musl.patch

(limited to 'dev-lang')

diff --git a/dev-lang/cxprolog/cxprolog-0.98.2.ebuild b/dev-lang/cxprolog/cxprolog-0.98.2.ebuild
index 24deb0a98e0e..494d1b7aef2b 100644
--- a/dev-lang/cxprolog/cxprolog-0.98.2.ebuild
+++ b/dev-lang/cxprolog/cxprolog-0.98.2.ebuild
@@ -32,6 +32,7 @@ S="${WORKDIR}"/${P}
 
 src_prepare() {
 	eapply "${FILESDIR}"/${P}-portage.patch
+	eapply "${FILESDIR}"/${P}/printf-musl.patch
 	eapply "${FILESDIR}"/${P}-test-io.patch
 	eapply_user
 
diff --git a/dev-lang/cxprolog/files/cxprolog-0.98.2-printf-musl.patch b/dev-lang/cxprolog/files/cxprolog-0.98.2-printf-musl.patch
new file mode 100644
index 000000000000..f55595461a80
--- /dev/null
+++ b/dev-lang/cxprolog/files/cxprolog-0.98.2-printf-musl.patch
@@ -0,0 +1,14 @@
+--- cxprolog-0.98.2.orig/src/Number.c	2016-01-23 22:07:48.000000000 +0100
++++ cxprolog-0.98.2/src/Number.c	2022-05-21 10:03:54.275367970 +0200
+@@ -282,9 +282,9 @@
+ {
+ #if HAS_LONG_DOUBLE_OPS
+ 	if( precision > 0 )
+-		return GStrFormat("%%.%dllg", precision) ;
++		return GStrFormat("%%.%dLg", precision) ;
+ 	else
+-		return GStrFormat("%%.%dllf", -precision) ;
++		return GStrFormat("%%.%dLf", -precision) ;
+ #else
+ 	if( precision > 0 )
+ 		return GStrFormat("%%.%dlg", precision) ;
-- 
cgit v1.2.3-65-gdbad