__USE_GNU_GETTEXT is exposed by musl because they provide
a GNU gettext-compatible interface. This doesn't mean they
provide all the internals that glibc does.
Check for __GLIBC__ if using internal _nl_msg_cat_cntr.
Closes: https://bugs.gentoo.org/716658
Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Sam James (sam_c) <sam@cmpct.info>
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
PATCHES=(
"${FILESDIR}/pid-patch.patch"
"${FILESDIR}/example.conf-user.patch"
+ "${FILESDIR}/musl-libintl.patch"
)
S="${WORKDIR}/${P}-source"
--- /dev/null
+diff --git a/src/language.cpp b/src/language.cpp
+index 1915378..c1eeea5 100644
+--- a/src/language.cpp
++++ b/src/language.cpp
+@@ -75,7 +75,7 @@ const char *Language::Translate(const NickCore *nc, const char *string)
+
+ #if GETTEXT_FOUND
+
+-#ifdef __USE_GNU_GETTEXT
++#if defined(__GLIBC__)
+ extern "C" int _nl_msg_cat_cntr;
+ #endif
+
+@@ -87,7 +87,7 @@ const char *Language::Translate(const char *lang, const char *string)
+ if (!lang || !*lang)
+ lang = Config->DefLanguage.c_str();
+
+-#ifdef __USE_GNU_GETTEXT
++#if defined(__GLIBC__)
+ ++_nl_msg_cat_cntr;
+ #endif
+