xmoto: fix musl build

This commit is contained in:
André Cerqueira 2022-10-09 14:29:04 +01:00 committed by Michal Vasilek
parent 16ef1c13d1
commit 3b0df2789d

View File

@ -0,0 +1,27 @@
From 7ce512bf0242182306ceb75d7dbe2370aab838f8 Mon Sep 17 00:00:00 2001
From: _yui <imbatman0xff@gmail.com>
Date: Sun, 9 Oct 2022 14:48:05 +0300
Subject: [PATCH] i18n: Don't use gettext GNU-isms with musl
---
src/common/Locales.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/common/Locales.cpp b/src/common/Locales.cpp
index 5ee395bd..680da00c 100644
--- a/src/common/Locales.cpp
+++ b/src/common/Locales.cpp
@@ -66,11 +66,13 @@ std::pair<std::string, std::string> Locales::changeLocale(
setlocale(LC_MESSAGES, NULL));
#endif
+#ifdef __GLIBC__
/* Make change known. */
{
extern int _nl_msg_cat_cntr;
++_nl_msg_cat_cntr;
}
+#endif
std::pair<std::string, std::string> locale_str(
locale.first == NULL ? std::string("") : std::string(locale.first),