[glib/glib.fixtools.i18n: 1/2] build: Determine the appropriate string for setlocale()
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib.fixtools.i18n: 1/2] build: Determine the appropriate string for setlocale()
- Date: Wed, 5 Jun 2019 14:37:56 +0000 (UTC)
commit d4c14aa8ffecfc672f630ab9274f14b9d227f2dd
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Wed Jun 5 16:34:57 2019 +0800
build: Determine the appropriate string for setlocale()
On Windows, in particular the CRTs on and after Visual Studio 2012, it
is not enough just to do setlocale (LC_ALL, "") to set the default
system locale, which results in the tools that use the translated
messages to show unreadable messages when running the commmand line
tools.
This adds an entry in glibconfig.h.in which denotes the appropriate
string to use for setlocale() to set the default system locale by
setting it to ".ACP" if we are building via Visual Studio and "" for
other compilers (as we are doing now).
The tools in gio/ will be updated in the next commit to make use of this
entry so that the translated messages can be shown correctly.
glib/glibconfig.h.in | 2 ++
meson.build | 6 ++++++
2 files changed, 8 insertions(+)
---
diff --git a/glib/glibconfig.h.in b/glib/glibconfig.h.in
index 2bf6c43c1..018d1ccfc 100644
--- a/glib/glibconfig.h.in
+++ b/glib/glibconfig.h.in
@@ -209,6 +209,8 @@ typedef @g_pid_type@ GPid;
#define G_SEARCHPATH_SEPARATOR '@g_searchpath_separator@'
#define G_SEARCHPATH_SEPARATOR_S "@g_searchpath_separator@"
+#define GLIB_DEFAULT_LOCALE_STRING "@glib_default_locale_string@"
+
G_END_DECLS
#endif /* __GLIBCONFIG_H__ */
diff --git a/meson.build b/meson.build
index da6822521..3cddb35b5 100644
--- a/meson.build
+++ b/meson.build
@@ -1690,6 +1690,12 @@ endif
glibconfig_conf.set10('G_HAVE_GROWING_STACK', growing_stack)
+if host_system == 'windows'
+ glibconfig_conf.set('glib_default_locale_string', '.ACP')
+else
+ glibconfig_conf.set('glib_default_locale_string', '')
+endif
+
# Tests for iconv
#
# We should never use the MinGW C library's iconv because it may not be
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]