[graphics/krita] 3rdparty: ki18n: fix loading our translations from Windows

L. E. Segovia null at kde.org
Fri Jun 18 17:13:39 BST 2021


Git commit 11db240d822ef3dc728e924f0b0d3ada147c582a by L. E. Segovia.
Committed on 15/06/2021 at 16:40.
Pushed by lsegovia into branch 'master'.

ki18n: fix loading our translations from Windows

This commit introduces a patch to k18n, suggested by Alvin Wong, to make
ki18n behave properly with our patched copy of gettext. The latter
contains a patch of vcpkg to make it behave with UTF-8 paths on Windows,
but this wasn't reflected on ki18n's initialization code.

The patch works by inserting an additional define in libintl.h that
flags the presence of vcpkg's UTF-8 patch. While at it, we update the
libgnuintl.win32.h template file to match the underlying gettext
version.

BUG: 438421

CCMAIL: kimageshop at kde.org

A  +40   -0    3rdparty/ext_frameworks/0001-ki18n-fix-loading-catalogs-with-patched-gettext.patch
M  +11   -1    3rdparty/ext_frameworks/CMakeLists.txt
M  +4    -4    3rdparty/ext_gettext/0001-Fix-macro-definitions.patch
M  +6    -6    3rdparty/ext_gettext/0002-Fix-uwp-build.patch
M  +22   -6    3rdparty/ext_gettext/0003-Fix-win-unicode-paths.patch
M  +313  -270  3rdparty/ext_gettext/0004-vcpkg-CMake-toolchain.patch

https://invent.kde.org/graphics/krita/commit/11db240d822ef3dc728e924f0b0d3ada147c582a

diff --git a/3rdparty/ext_frameworks/0001-ki18n-fix-loading-catalogs-with-patched-gettext.patch b/3rdparty/ext_frameworks/0001-ki18n-fix-loading-catalogs-with-patched-gettext.patch
new file mode 100644
index 0000000000..4b0c863e16
--- /dev/null
+++ b/3rdparty/ext_frameworks/0001-ki18n-fix-loading-catalogs-with-patched-gettext.patch
@@ -0,0 +1,40 @@
+From 7442b1415a651a1396a0b2387cf085d0a0dfdfef Mon Sep 17 00:00:00 2001
+From: Alvin Wong <alvin at alvinhc.com>
+Date: Tue, 15 Jun 2021 16:43:02 +0000
+Subject: [PATCH] ki18n: fix loading catalogs with patched gettext
+
+---
+ src/kcatalog.cpp | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/src/kcatalog.cpp b/src/kcatalog.cpp
+index df33e5f..0143c13 100644
+--- a/src/kcatalog.cpp
++++ b/src/kcatalog.cpp
+@@ -32,6 +32,7 @@
+ #include <QFileInfo>
+ #include <QMutexLocker>
+ #include <QSet>
++#include <QString>
+ #include <QStringList>
+ 
+ #include <kcatalog_p.h>
+@@ -92,8 +93,15 @@ KCatalog::KCatalog(const QByteArray &domain, const QString &language_)
+     : d(new KCatalogPrivate)
+ {
+     d->domain = domain;
++#if defined(_WIN32) && defined(__WIN32_USE_UTF8)
++    // Krita uses Microsoft's patched version of gettext to support UTF-8 paths.
++    // Convert the paths to UTF-8 prior to sending.
++    d->language = language_.toUtf8();
++    d->localeDir = catalogLocaleDir(domain, language_).toUtf8();
++#else
+     d->language = QFile::encodeName(language_);
+     d->localeDir = QFile::encodeName(catalogLocaleDir(domain, language_));
++#endif
+ 
+     if (!d->localeDir.isEmpty()) {
+         // Always get translations in UTF-8, regardless of user's environment.
+-- 
+2.31.1.windows.1
+
diff --git a/3rdparty/ext_frameworks/CMakeLists.txt b/3rdparty/ext_frameworks/CMakeLists.txt
index a9de40b507..be2517aa8a 100644
--- a/3rdparty/ext_frameworks/CMakeLists.txt
+++ b/3rdparty/ext_frameworks/CMakeLists.txt
@@ -163,13 +163,23 @@ ExternalProject_Add(
     DEPENDS ext_kguiaddons ext_gettext
 )
 else()
+
+set(ext_ki18n_PATCH_COMMAND
+    COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/ki18n-appdatalocation.diff
+)
+if (WIN32)
+set(ext_ki18n_PATCH_COMMAND ${_ki18n_patch}
+    COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0001-ki18n-fix-loading-catalogs-with-patched-gettext.patch
+)
+endif()
+
 ExternalProject_Add(
     ext_ki18n
     DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
         URL https://download.kde.org/stable/frameworks/5.64/ki18n-5.64.0.zip
     URL_MD5 75a86675bf2b352b53cbcaece956b486
     INSTALL_DIR ${EXTPREFIX_frameworks}
-    PATCH_COMMAND COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/ki18n-appdatalocation.diff
+    PATCH_COMMAND ${ext_ki18n_PATCH_COMMAND}
     CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_frameworks}
             -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} 
                 ${GLOBAL_PROFILE}
diff --git a/3rdparty/ext_gettext/0001-Fix-macro-definitions.patch b/3rdparty/ext_gettext/0001-Fix-macro-definitions.patch
index ad6024d7d3..8fc676f7ad 100644
--- a/3rdparty/ext_gettext/0001-Fix-macro-definitions.patch
+++ b/3rdparty/ext_gettext/0001-Fix-macro-definitions.patch
@@ -1,7 +1,7 @@
-From 2cc77af610d89a97322f662aaead435c1597941c Mon Sep 17 00:00:00 2001
+From 328ffbf205a23164c7528a9a5f3feb684dd4c11c Mon Sep 17 00:00:00 2001
 From: "L. E. Segovia" <amy at amyspark.me>
 Date: Sat, 20 Feb 2021 20:03:28 +0000
-Subject: [PATCH 1/5] Fix macro definitions
+Subject: [PATCH 1/4] Fix macro definitions
 
 https://github.com/microsoft/vcpkg/tree/c84dfe7ddd6f3ba14ec9f4b1f2c577365175128b/ports/gettext
 ---
@@ -9,7 +9,7 @@ https://github.com/microsoft/vcpkg/tree/c84dfe7ddd6f3ba14ec9f4b1f2c577365175128b
  1 file changed, 5 insertions(+)
 
 diff --git a/gettext-runtime/intl/xsize.h b/gettext-runtime/intl/xsize.h
-index 9b9840f7..3007228a 100644
+index 9b9840f..3007228 100644
 --- a/gettext-runtime/intl/xsize.h
 +++ b/gettext-runtime/intl/xsize.h
 @@ -29,6 +29,11 @@
@@ -25,5 +25,5 @@ index 9b9840f7..3007228a 100644
  #ifndef _GL_INLINE_HEADER_BEGIN
   #error "Please include config.h first."
 -- 
-2.30.0
+2.31.1.windows.1
 
diff --git a/3rdparty/ext_gettext/0002-Fix-uwp-build.patch b/3rdparty/ext_gettext/0002-Fix-uwp-build.patch
index 1d67fa4034..69502bda94 100644
--- a/3rdparty/ext_gettext/0002-Fix-uwp-build.patch
+++ b/3rdparty/ext_gettext/0002-Fix-uwp-build.patch
@@ -1,7 +1,7 @@
-From 769ef6c47efaf552e3c6ff35e12733cdb1d80f17 Mon Sep 17 00:00:00 2001
+From 01bc26c9b77c54544fc25184b1b229894f83d9fc Mon Sep 17 00:00:00 2001
 From: "L. E. Segovia" <amy at amyspark.me>
 Date: Sat, 20 Feb 2021 20:04:21 +0000
-Subject: [PATCH 2/5] Fix uwp build
+Subject: [PATCH 2/4] Fix uwp build
 
 ---
  gettext-runtime/intl/langprefs.c    | 10 ++++++++--
@@ -10,7 +10,7 @@ Subject: [PATCH 2/5] Fix uwp build
  3 files changed, 28 insertions(+), 6 deletions(-)
 
 diff --git a/gettext-runtime/intl/langprefs.c b/gettext-runtime/intl/langprefs.c
-index f774ba2b..498933a7 100644
+index f774ba2..498933a 100644
 --- a/gettext-runtime/intl/langprefs.c
 +++ b/gettext-runtime/intl/langprefs.c
 @@ -36,8 +36,14 @@
@@ -31,7 +31,7 @@ index f774ba2b..498933a7 100644
  
  #ifdef WIN32_NATIVE
 diff --git a/gettext-runtime/intl/localcharset.c b/gettext-runtime/intl/localcharset.c
-index ec754276..3028bc28 100644
+index ec75427..3028bc2 100644
 --- a/gettext-runtime/intl/localcharset.c
 +++ b/gettext-runtime/intl/localcharset.c
 @@ -36,6 +36,16 @@
@@ -70,7 +70,7 @@ index ec754276..3028bc28 100644
    char buf[2 + 10 + 1];
    static char resultbuf[2 + 10 + 1];
 diff --git a/gettext-runtime/intl/localename.c b/gettext-runtime/intl/localename.c
-index 6458f757..a3845a4f 100644
+index 6458f75..a3845a4 100644
 --- a/gettext-runtime/intl/localename.c
 +++ b/gettext-runtime/intl/localename.c
 @@ -72,8 +72,14 @@ extern char * getlocalename_l(int, locale_t);
@@ -91,5 +91,5 @@ index 6458f757..a3845a4f 100644
  #  include "glthread/lock.h"
  # endif
 -- 
-2.30.0
+2.31.1.windows.1
 
diff --git a/3rdparty/ext_gettext/0003-Fix-win-unicode-paths.patch b/3rdparty/ext_gettext/0003-Fix-win-unicode-paths.patch
index 6de77135a3..9473c37476 100644
--- a/3rdparty/ext_gettext/0003-Fix-win-unicode-paths.patch
+++ b/3rdparty/ext_gettext/0003-Fix-win-unicode-paths.patch
@@ -1,14 +1,30 @@
-From 61cefcbb98613fff9a3864b81299611c4493adf5 Mon Sep 17 00:00:00 2001
+From bceab06e99595db3ff6d84cf18af3f6b576a1e5b Mon Sep 17 00:00:00 2001
 From: "L. E. Segovia" <amy at amyspark.me>
 Date: Sat, 20 Feb 2021 20:05:25 +0000
-Subject: [PATCH 3/5] Fix win unicode paths
+Subject: [PATCH 3/4] Fix win unicode paths
 
 ---
- gettext-runtime/intl/loadmsgcat.c | 49 +++++++++++++++++++++++++++++++
- 1 file changed, 49 insertions(+)
+ gettext-runtime/intl/libgnuintl.in.h |  4 +++
+ gettext-runtime/intl/loadmsgcat.c    | 49 ++++++++++++++++++++++++++++
+ 2 files changed, 53 insertions(+)
 
+diff --git a/gettext-runtime/intl/libgnuintl.in.h b/gettext-runtime/intl/libgnuintl.in.h
+index 6fb1920..93cd4b5 100644
+--- a/gettext-runtime/intl/libgnuintl.in.h
++++ b/gettext-runtime/intl/libgnuintl.in.h
+@@ -37,6 +37,10 @@
+    implementation of gettext.  */
+ #define __USE_GNU_GETTEXT 1
+ 
++/* We define an additional symbol to signal that this version of
++   gettext is patched to use UTF-8 paths on Windows.  */
++#define __WIN32_USE_UTF8 1
++
+ /* Provide information about the supported file formats.  Returns the
+    maximum minor revision number supported for a given major revision.  */
+ #define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
 diff --git a/gettext-runtime/intl/loadmsgcat.c b/gettext-runtime/intl/loadmsgcat.c
-index 016fe575..030b8619 100644
+index 016fe57..030b861 100644
 --- a/gettext-runtime/intl/loadmsgcat.c
 +++ b/gettext-runtime/intl/loadmsgcat.c
 @@ -388,6 +388,55 @@ char *alloca ();
@@ -68,5 +84,5 @@ index 016fe575..030b8619 100644
     some additional code emulating it.  */
  #ifdef HAVE_ALLOCA
 -- 
-2.30.0
+2.31.1.windows.1
 
diff --git a/3rdparty/ext_gettext/0004-vcpkg-CMake-toolchain.patch b/3rdparty/ext_gettext/0004-vcpkg-CMake-toolchain.patch
index 2f054583ee..654894bf56 100644
--- a/3rdparty/ext_gettext/0004-vcpkg-CMake-toolchain.patch
+++ b/3rdparty/ext_gettext/0004-vcpkg-CMake-toolchain.patch
@@ -1,7 +1,7 @@
-From b44fc78dae21ca8e50596bcabd6a9112b8709b44 Mon Sep 17 00:00:00 2001
+From a0dcf18117183c5bb58358c1f0ebad112ef8fd8b Mon Sep 17 00:00:00 2001
 From: "L. E. Segovia" <amy at amyspark.me>
 Date: Sun, 21 Feb 2021 11:49:39 +0000
-Subject: [PATCH 4/5] vcpkg CMake toolchain
+Subject: [PATCH 4/4] vcpkg CMake toolchain
 
 Adapted from https://github.com/microsoft/vcpkg/tree/c84dfe7ddd6f3ba14ec9f4b1f2c577365175128b/ports/gettext
 ---
@@ -9,10 +9,10 @@ Adapted from https://github.com/microsoft/vcpkg/tree/c84dfe7ddd6f3ba14ec9f4b1f2c
  gettext-runtime/CMakeLists.txt          |  159 ++++
  gettext-runtime/config.unix.h.in        | 1009 +++++++++++++++++++++++
  gettext-runtime/config.win32.h          |  835 +++++++++++++++++++
- gettext-runtime/intl/libgnuintl.win32.h |  423 ++++++++++
+ gettext-runtime/intl/libgnuintl.win32.h |  467 +++++++++++
  gettext-runtime/intl/libintl.rc         |   38 -
  gettext-runtime/intl/libintl.rc.in      |   38 +
- 7 files changed, 2477 insertions(+), 38 deletions(-)
+ 7 files changed, 2521 insertions(+), 38 deletions(-)
  create mode 100644 CMakeLists.txt
  create mode 100644 gettext-runtime/CMakeLists.txt
  create mode 100644 gettext-runtime/config.unix.h.in
@@ -23,7 +23,7 @@ Adapted from https://github.com/microsoft/vcpkg/tree/c84dfe7ddd6f3ba14ec9f4b1f2c
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
 new file mode 100644
-index 00000000..340296a5
+index 0000000..340296a
 --- /dev/null
 +++ b/CMakeLists.txt
 @@ -0,0 +1,13 @@
@@ -42,7 +42,7 @@ index 00000000..340296a5
 +add_subdirectory(gettext-runtime)
 diff --git a/gettext-runtime/CMakeLists.txt b/gettext-runtime/CMakeLists.txt
 new file mode 100644
-index 00000000..16f64440
+index 0000000..8c6d22e
 --- /dev/null
 +++ b/gettext-runtime/CMakeLists.txt
 @@ -0,0 +1,159 @@
@@ -207,7 +207,7 @@ index 00000000..16f64440
 +)
 diff --git a/gettext-runtime/config.unix.h.in b/gettext-runtime/config.unix.h.in
 new file mode 100644
-index 00000000..51e5cf67
+index 0000000..51e5cf6
 --- /dev/null
 +++ b/gettext-runtime/config.unix.h.in
 @@ -0,0 +1,1009 @@
@@ -1222,7 +1222,7 @@ index 00000000..51e5cf67
 +
 diff --git a/gettext-runtime/config.win32.h b/gettext-runtime/config.win32.h
 new file mode 100644
-index 00000000..1093a7f5
+index 0000000..1093a7f
 --- /dev/null
 +++ b/gettext-runtime/config.win32.h
 @@ -0,0 +1,835 @@
@@ -2063,30 +2063,28 @@ index 00000000..1093a7f5
 +
 diff --git a/gettext-runtime/intl/libgnuintl.win32.h b/gettext-runtime/intl/libgnuintl.win32.h
 new file mode 100644
-index 00000000..440da4d5
+index 0000000..8ffb22f
 --- /dev/null
 +++ b/gettext-runtime/intl/libgnuintl.win32.h
-@@ -0,0 +1,423 @@
+@@ -0,0 +1,467 @@
 +/* Message catalogs for internationalization.
-+Copyright (C) 1995-1997, 2000-2007 Free Software Foundation, Inc.
++   Copyright (C) 1995-1997, 2000-2016, 2018-2020 Free Software Foundation, Inc.
 +
-+This program is free software; you can redistribute it and/or modify it
-+under the terms of the GNU Library General Public License as published
-+by the Free Software Foundation; either version 2, or (at your option)
-+any later version.
++   This program is free software: you can redistribute it and/or modify
++   it under the terms of the GNU Lesser General Public License as published by
++   the Free Software Foundation; either version 2.1 of the License, or
++   (at your option) any later version.
 +
-+This program is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+Library General Public License for more details.
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU Lesser General Public License for more details.
 +
-+You should have received a copy of the GNU Library General Public
-+License along with this program; if not, write to the Free Software
-+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-+USA.  */
++   You should have received a copy of the GNU Lesser General Public License
++   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 +
 +#ifndef _LIBINTL_H
-+#define _LIBINTL_H	1
++#define _LIBINTL_H 1
 +
 +#if defined(_WIN32) && defined(libintl_EXPORTS)
 +#define LIBINTL_DLL_EXPORTED __declspec(dllexport)
@@ -2095,405 +2093,450 @@ index 00000000..440da4d5
 +#endif
 +
 +#include <locale.h>
++#if (defined __APPLE__ && defined __MACH__) && @HAVE_NEWLOCALE @
++#include <xlocale.h>
++#endif
 +
 +/* The LC_MESSAGES locale category is the category used by the functions
-+gettext() and dgettext().  It is specified in POSIX, but not in ANSI C.
-+On systems that don't define it, use an arbitrary value instead.
-+On Solaris, <locale.h> defines __LOCALE_H (or _LOCALE_H in Solaris 2.5)
-+then includes <libintl.h> (i.e. this file!) and then only defines
-+LC_MESSAGES.  To avoid a redefinition warning, don't define LC_MESSAGES
-+in this case.  */
++   gettext() and dgettext().  It is specified in POSIX, but not in ANSI C.
++   On systems that don't define it, use an arbitrary value instead.
++   On Solaris, <locale.h> defines __LOCALE_H (or _LOCALE_H in Solaris 2.5)
++   then includes <libintl.h> (i.e. this file!) and then only defines
++   LC_MESSAGES.  To avoid a redefinition warning, don't define LC_MESSAGES
++   in this case.  */
 +#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun))
-+# define LC_MESSAGES 1729
++#define LC_MESSAGES 1729
 +#endif
 +
 +/* We define an additional symbol to signal that we use the GNU
-+implementation of gettext.  */
++   implementation of gettext.  */
 +#define __USE_GNU_GETTEXT 1
 +
++/* We define an additional symbol to signal that this version of
++   gettext is patched to use UTF-8 paths on Windows.  */
++#define __WIN32_USE_UTF8 1
++
 +/* Provide information about the supported file formats.  Returns the
-+maximum minor revision number supported for a given major revision.  */
-+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
-+  ((major) == 0 || (major) == 1 ? 1 : -1)
++   maximum minor revision number supported for a given major revision.  */
++#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 || (major) == 1 ? 1 : -1)
 +
 +/* Resolve a platform specific conflict on DJGPP.  GNU gettext takes
-+precedence over _conio_gettext.  */
++   precedence over _conio_gettext.  */
 +#ifdef __DJGPP__
-+# undef gettext
++#undef gettext
 +#endif
 +
 +#ifdef __cplusplus
 +extern "C" {
 +#endif
 +
-+
-+	/* Version number: (major<<16) + (minor<<8) + subminor */
-+#define LIBINTL_VERSION 0x001100
-+	extern LIBINTL_DLL_EXPORTED int libintl_version;
-+
-+
-+	/* We redirect the functions to those prefixed with "libintl_".  This is
-+	necessary, because some systems define gettext/textdomain/... in the C
-+	library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer).
-+	If we used the unprefixed names, there would be cases where the
-+	definition in the C library would override the one in the libintl.so
-+	shared library.  Recall that on ELF systems, the symbols are looked
-+	up in the following order:
-+	1. in the executable,
-+	2. in the shared libraries specified on the link command line, in order,
-+	3. in the dependencies of the shared libraries specified on the link
-+	command line,
-+	4. in the dlopen()ed shared libraries, in the order in which they were
-+	dlopen()ed.
-+	The definition in the C library would override the one in libintl.so if
-+	either
-+	* -lc is given on the link command line and -lintl isn't, or
-+	* -lc is given on the link command line before -lintl, or
-+	* libintl.so is a dependency of a dlopen()ed shared library but not
-+	linked to the executable at link time.
-+	Since Solaris gettext() behaves differently than GNU gettext(), this
-+	would be unacceptable.
-+
-+	The redirection happens by default through macros in C, so that &gettext
-+	is independent of the compilation unit, but through inline functions in
-+	C++, in order not to interfere with the name mangling of class fields or
-+	class methods called 'gettext'.  */
-+
-+	/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS.
-+	If he doesn't, we choose the method.  A third possible method is
-+	_INTL_REDIRECT_ASM, supported only by GCC.  */
++/* Version number: (major<<16) + (minor<<8) + subminor */
++#define LIBINTL_VERSION 0x001500
++extern LIBINTL_DLL_EXPORTED int libintl_version;
++
++/* We redirect the functions to those prefixed with "libintl_".  This is
++   necessary, because some systems define gettext/textdomain/... in the C
++   library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer).
++   If we used the unprefixed names, there would be cases where the
++   definition in the C library would override the one in the libintl.so
++   shared library.  Recall that on ELF systems, the symbols are looked
++   up in the following order:
++     1. in the executable,
++     2. in the shared libraries specified on the link command line, in order,
++     3. in the dependencies of the shared libraries specified on the link
++        command line,
++     4. in the dlopen()ed shared libraries, in the order in which they were
++        dlopen()ed.
++   The definition in the C library would override the one in libintl.so if
++   either
++     * -lc is given on the link command line and -lintl isn't, or
++     * -lc is given on the link command line before -lintl, or
++     * libintl.so is a dependency of a dlopen()ed shared library but not
++       linked to the executable at link time.
++   Since Solaris gettext() behaves differently than GNU gettext(), this
++   would be unacceptable.
++
++   The redirection happens by default through macros in C, so that &gettext
++   is independent of the compilation unit, but through inline functions in
++   C++, in order not to interfere with the name mangling of class fields or
++   class methods called 'gettext'.  */
++
++/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS.
++   If he doesn't, we choose the method.  A third possible method is
++   _INTL_REDIRECT_ASM, supported only by GCC.  */
 +#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
-+# if __GNUC__ >= 2 && !(__APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
-+#  define _INTL_REDIRECT_ASM
-+# else
-+#  ifdef __cplusplus
-+#   define _INTL_REDIRECT_INLINE
-+#  else
-+#   define _INTL_REDIRECT_MACROS
-+#  endif
-+# endif
++#if defined __GNUC__ && __GNUC__ >= 2 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
++#define _INTL_REDIRECT_ASM
++#else
++#ifdef __cplusplus
++#define _INTL_REDIRECT_INLINE
++#else
++#define _INTL_REDIRECT_MACROS
 +#endif
-+	/* Auxiliary macros.  */
++#endif
++#endif
++/* Auxiliary macros.  */
 +#ifdef _INTL_REDIRECT_ASM
-+# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname))
-+# define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring
-+# define _INTL_STRINGIFY(prefix) #prefix
++#define _INTL_ASM(cname) __asm__(_INTL_ASMNAME(__USER_LABEL_PREFIX__, #cname))
++#define _INTL_ASMNAME(prefix, cnamestring) _INTL_STRINGIFY(prefix) cnamestring
++#define _INTL_STRINGIFY(prefix) #prefix
 +#else
-+# define _INTL_ASM(cname)
++#define _INTL_ASM(cname)
 +#endif
 +
-+	/* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return
-+	its n-th argument literally.  This enables GCC to warn for example about
-+	printf (gettext ("foo %y")).  */
-+#if __GNUC__ >= 3 && !(__APPLE_CC__ > 1 && defined __cplusplus)
-+# define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n)))
++/* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return
++   its n-th argument literally.  This enables GCC to warn for example about
++   printf (gettext ("foo %y")).  */
++#if defined __GNUC__ && __GNUC__ >= 3 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1 && !(defined __clang__ && __clang__ && __clang_major__ >= 3) && defined __cplusplus)
++#define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__((__format_arg__(n)))
 +#else
-+# define _INTL_MAY_RETURN_STRING_ARG(n)
++#define _INTL_MAY_RETURN_STRING_ARG(n)
 +#endif
 +
-+	/* Look up MSGID in the current default message catalog for the current
-+	LC_MESSAGES locale.  If not found, returns MSGID itself (the default
-+	text).  */
++/* Look up MSGID in the current default message catalog for the current
++   LC_MESSAGES locale.  If not found, returns MSGID itself (the default
++   text).  */
 +#ifdef _INTL_REDIRECT_INLINE
-+	extern LIBINTL_DLL_EXPORTED char *libintl_gettext(const char *__msgid)
-+		_INTL_MAY_RETURN_STRING_ARG(1);
-+	static inline char *gettext(const char *__msgid)
-+	{
-+		return libintl_gettext(__msgid);
-+	}
++extern LIBINTL_DLL_EXPORTED char *libintl_gettext(const char *__msgid) _INTL_MAY_RETURN_STRING_ARG(1);
++static inline _INTL_MAY_RETURN_STRING_ARG(1) char *gettext(const char *__msgid)
++{
++    return libintl_gettext(__msgid);
++}
 +#else
 +#ifdef _INTL_REDIRECT_MACROS
-+# define gettext libintl_gettext
++#define gettext libintl_gettext
 +#endif
-+	extern LIBINTL_DLL_EXPORTED char *gettext(const char *__msgid)
-+		_INTL_ASM(libintl_gettext)
-+		_INTL_MAY_RETURN_STRING_ARG(1);
++extern LIBINTL_DLL_EXPORTED char *gettext(const char *__msgid) _INTL_ASM(libintl_gettext) _INTL_MAY_RETURN_STRING_ARG(1);
 +#endif
 +
-+	/* Look up MSGID in the DOMAINNAME message catalog for the current
-+	LC_MESSAGES locale.  */
++/* Look up MSGID in the DOMAINNAME message catalog for the current
++   LC_MESSAGES locale.  */
 +#ifdef _INTL_REDIRECT_INLINE
-+	extern LIBINTL_DLL_EXPORTED char *libintl_dgettext(const char *__domainname, const char *__msgid)
-+		_INTL_MAY_RETURN_STRING_ARG(2);
-+	static inline char *dgettext(const char *__domainname, const char *__msgid)
-+	{
-+		return libintl_dgettext(__domainname, __msgid);
-+	}
++extern LIBINTL_DLL_EXPORTED char *libintl_dgettext(const char *__domainname, const char *__msgid) _INTL_MAY_RETURN_STRING_ARG(2);
++static inline _INTL_MAY_RETURN_STRING_ARG(2) char *dgettext(const char *__domainname, const char *__msgid)
++{
++    return libintl_dgettext(__domainname, __msgid);
++}
 +#else
 +#ifdef _INTL_REDIRECT_MACROS
-+# define dgettext libintl_dgettext
++#define dgettext libintl_dgettext
 +#endif
-+	extern LIBINTL_DLL_EXPORTED char *dgettext(const char *__domainname, const char *__msgid)
-+		_INTL_ASM(libintl_dgettext)
-+		_INTL_MAY_RETURN_STRING_ARG(2);
++extern LIBINTL_DLL_EXPORTED char *dgettext(const char *__domainname, const char *__msgid) _INTL_ASM(libintl_dgettext) _INTL_MAY_RETURN_STRING_ARG(2);
 +#endif
 +
-+	/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
-+	locale.  */
++/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
++   locale.  */
 +#ifdef _INTL_REDIRECT_INLINE
-+	extern LIBINTL_DLL_EXPORTED char *libintl_dcgettext(const char *__domainname, const char *__msgid,
-+		int __category)
-+		_INTL_MAY_RETURN_STRING_ARG(2);
-+	static inline char *dcgettext(const char *__domainname, const char *__msgid,
-+		int __category)
-+	{
-+		return libintl_dcgettext(__domainname, __msgid, __category);
-+	}
++extern LIBINTL_DLL_EXPORTED char *libintl_dcgettext(const char *__domainname, const char *__msgid, int __category) _INTL_MAY_RETURN_STRING_ARG(2);
++static inline _INTL_MAY_RETURN_STRING_ARG(2) char *dcgettext(const char *__domainname, const char *__msgid, int __category)
++{
++    return libintl_dcgettext(__domainname, __msgid, __category);
++}
 +#else
 +#ifdef _INTL_REDIRECT_MACROS
-+# define dcgettext libintl_dcgettext
++#define dcgettext libintl_dcgettext
 +#endif
-+	extern LIBINTL_DLL_EXPORTED char *dcgettext(const char *__domainname, const char *__msgid,
-+		int __category)
-+		_INTL_ASM(libintl_dcgettext)
-+		_INTL_MAY_RETURN_STRING_ARG(2);
++extern LIBINTL_DLL_EXPORTED char *dcgettext(const char *__domainname, const char *__msgid, int __category) _INTL_ASM(libintl_dcgettext) _INTL_MAY_RETURN_STRING_ARG(2);
 +#endif
 +
-+
-+	/* Similar to `gettext' but select the plural form corresponding to the
-+	number N.  */
++/* Similar to 'gettext' but select the plural form corresponding to the
++   number N.  */
 +#ifdef _INTL_REDIRECT_INLINE
-+	extern LIBINTL_DLL_EXPORTED char *libintl_ngettext(const char *__msgid1, const char *__msgid2,
-+		unsigned long int __n)
-+		_INTL_MAY_RETURN_STRING_ARG(1) _INTL_MAY_RETURN_STRING_ARG(2);
-+	static inline char *ngettext(const char *__msgid1, const char *__msgid2,
-+		unsigned long int __n)
-+	{
-+		return libintl_ngettext(__msgid1, __msgid2, __n);
-+	}
++extern LIBINTL_DLL_EXPORTED char *libintl_ngettext(const char *__msgid1, const char *__msgid2, unsigned long int __n) _INTL_MAY_RETURN_STRING_ARG(1) _INTL_MAY_RETURN_STRING_ARG(2);
++static inline _INTL_MAY_RETURN_STRING_ARG(1) _INTL_MAY_RETURN_STRING_ARG(2) char *ngettext(const char *__msgid1, const char *__msgid2, unsigned long int __n)
++{
++    return libintl_ngettext(__msgid1, __msgid2, __n);
++}
 +#else
 +#ifdef _INTL_REDIRECT_MACROS
-+# define ngettext libintl_ngettext
++#define ngettext libintl_ngettext
 +#endif
-+	extern LIBINTL_DLL_EXPORTED char *ngettext(const char *__msgid1, const char *__msgid2,
-+		unsigned long int __n)
-+		_INTL_ASM(libintl_ngettext)
-+		_INTL_MAY_RETURN_STRING_ARG(1) _INTL_MAY_RETURN_STRING_ARG(2);
++extern LIBINTL_DLL_EXPORTED char *ngettext(const char *__msgid1, const char *__msgid2, unsigned long int __n) _INTL_ASM(libintl_ngettext) _INTL_MAY_RETURN_STRING_ARG(1) _INTL_MAY_RETURN_STRING_ARG(2);
 +#endif
 +
-+	/* Similar to `dgettext' but select the plural form corresponding to the
-+	number N.  */
++/* Similar to 'dgettext' but select the plural form corresponding to the
++   number N.  */
 +#ifdef _INTL_REDIRECT_INLINE
-+	extern LIBINTL_DLL_EXPORTED char *libintl_dngettext(const char *__domainname, const char *__msgid1,
-+		const char *__msgid2, unsigned long int __n)
-+		_INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3);
-+	static inline char *dngettext(const char *__domainname, const char *__msgid1,
-+		const char *__msgid2, unsigned long int __n)
-+	{
-+		return libintl_dngettext(__domainname, __msgid1, __msgid2, __n);
-+	}
++extern LIBINTL_DLL_EXPORTED char *libintl_dngettext(const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n) _INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3);
++static inline _INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3) char *dngettext(const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n)
++{
++    return libintl_dngettext(__domainname, __msgid1, __msgid2, __n);
++}
 +#else
 +#ifdef _INTL_REDIRECT_MACROS
-+# define dngettext libintl_dngettext
++#define dngettext libintl_dngettext
 +#endif
-+	extern LIBINTL_DLL_EXPORTED char *dngettext(const char *__domainname,
-+		const char *__msgid1, const char *__msgid2,
-+		unsigned long int __n)
-+		_INTL_ASM(libintl_dngettext)
-+		_INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3);
++extern LIBINTL_DLL_EXPORTED char *dngettext(const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n) _INTL_ASM(libintl_dngettext) _INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3);
 +#endif
 +
-+	/* Similar to `dcgettext' but select the plural form corresponding to the
-+	number N.  */
++/* Similar to 'dcgettext' but select the plural form corresponding to the
++   number N.  */
 +#ifdef _INTL_REDIRECT_INLINE
-+	extern LIBINTL_DLL_EXPORTED char *libintl_dcngettext(const char *__domainname,
-+		const char *__msgid1, const char *__msgid2,
-+		unsigned long int __n, int __category)
-+		_INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3);
-+	static inline char *dcngettext(const char *__domainname,
-+		const char *__msgid1, const char *__msgid2,
-+		unsigned long int __n, int __category)
-+	{
-+		return libintl_dcngettext(__domainname, __msgid1, __msgid2, __n, __category);
-+	}
++extern LIBINTL_DLL_EXPORTED char *libintl_dcngettext(const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category) _INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3);
++static inline _INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3) char *dcngettext(const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category)
++{
++    return libintl_dcngettext(__domainname, __msgid1, __msgid2, __n, __category);
++}
 +#else
 +#ifdef _INTL_REDIRECT_MACROS
-+# define dcngettext libintl_dcngettext
++#define dcngettext libintl_dcngettext
 +#endif
-+	extern LIBINTL_DLL_EXPORTED char *dcngettext(const char *__domainname,
-+		const char *__msgid1, const char *__msgid2,
-+		unsigned long int __n, int __category)
-+		_INTL_ASM(libintl_dcngettext)
-+		_INTL_MAY_RETURN_STRING_ARG(2) _INTL_MAY_RETURN_STRING_ARG(3);
++extern LIBINTL_DLL_EXPORTED char *dcngettext(const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category) _INTL_ASM(libintl_dcngettext) _INTL_MAY_RETURN_STRING_ARG(2)
++    _INTL_MAY_RETURN_STRING_ARG(3);
 +#endif
 +
++#ifndef IN_LIBGLOCALE
 +
-+
-+	/* Set the current default message catalog to DOMAINNAME.
-+	If DOMAINNAME is null, return the current default.
-+	If DOMAINNAME is "", reset to the default of "messages".  */
++/* Set the current default message catalog to DOMAINNAME.
++   If DOMAINNAME is null, return the current default.
++   If DOMAINNAME is "", reset to the default of "messages".  */
 +#ifdef _INTL_REDIRECT_INLINE
-+	extern LIBINTL_DLL_EXPORTED char *libintl_textdomain(const char *__domainname);
-+	static inline char *textdomain(const char *__domainname)
-+	{
-+		return libintl_textdomain(__domainname);
-+	}
++extern LIBINTL_DLL_EXPORTED char *libintl_textdomain(const char *__domainname);
++static inline char *textdomain(const char *__domainname)
++{
++    return libintl_textdomain(__domainname);
++}
 +#else
 +#ifdef _INTL_REDIRECT_MACROS
-+# define textdomain libintl_textdomain
++#define textdomain libintl_textdomain
 +#endif
-+	extern LIBINTL_DLL_EXPORTED char *textdomain(const char *__domainname)
-+		_INTL_ASM(libintl_textdomain);
++extern LIBINTL_DLL_EXPORTED char *textdomain(const char *__domainname) _INTL_ASM(libintl_textdomain);
 +#endif
 +
-+	/* Specify that the DOMAINNAME message catalog will be found
-+	in DIRNAME rather than in the system locale data base.  */
++/* Specify that the DOMAINNAME message catalog will be found
++   in DIRNAME rather than in the system locale data base.  */
 +#ifdef _INTL_REDIRECT_INLINE
-+	extern LIBINTL_DLL_EXPORTED char *libintl_bindtextdomain(const char *__domainname,
-+		const char *__dirname);
-+	static inline char *bindtextdomain(const char *__domainname,
-+		const char *__dirname)
-+	{
-+		return libintl_bindtextdomain(__domainname, __dirname);
-+	}
++extern LIBINTL_DLL_EXPORTED char *libintl_bindtextdomain(const char *__domainname, const char *__dirname);
++static inline char *bindtextdomain(const char *__domainname, const char *__dirname)
++{
++    return libintl_bindtextdomain(__domainname, __dirname);
++}
 +#else
 +#ifdef _INTL_REDIRECT_MACROS
-+# define bindtextdomain libintl_bindtextdomain
++#define bindtextdomain libintl_bindtextdomain
 +#endif
-+	extern LIBINTL_DLL_EXPORTED char *bindtextdomain(const char *__domainname, const char *__dirname)
-+		_INTL_ASM(libintl_bindtextdomain);
++extern LIBINTL_DLL_EXPORTED char *bindtextdomain(const char *__domainname, const char *__dirname) _INTL_ASM(libintl_bindtextdomain);
 +#endif
 +
-+	/* Specify the character encoding in which the messages from the
-+	DOMAINNAME message catalog will be returned.  */
++#if defined _WIN32 && !defined __CYGWIN__
++/* Specify that the DOMAINNAME message catalog will be found
++   in WDIRNAME rather than in the system locale data base.  */
 +#ifdef _INTL_REDIRECT_INLINE
-+	extern LIBINTL_DLL_EXPORTED char *libintl_bind_textdomain_codeset(const char *__domainname,
-+		const char *__codeset);
-+	static inline char *bind_textdomain_codeset(const char *__domainname,
-+		const char *__codeset)
-+	{
-+		return libintl_bind_textdomain_codeset(__domainname, __codeset);
-+	}
++extern LIBINTL_DLL_EXPORTED wchar_t *libintl_wbindtextdomain(const char *__domainname, const wchar_t *__wdirname);
++static inline wchar_t *wbindtextdomain(const char *__domainname, const wchar_t *__wdirname)
++{
++    return libintl_wbindtextdomain(__domainname, __wdirname);
++}
 +#else
 +#ifdef _INTL_REDIRECT_MACROS
-+# define bind_textdomain_codeset libintl_bind_textdomain_codeset
++#define wbindtextdomain libintl_wbindtextdomain
++#endif
++extern LIBINTL_DLL_EXPORTED wchar_t *wbindtextdomain(const char *__domainname, const wchar_t *__wdirname) _INTL_ASM(libintl_wbindtextdomain);
 +#endif
-+	extern LIBINTL_DLL_EXPORTED char *bind_textdomain_codeset(const char *__domainname,
-+		const char *__codeset)
-+		_INTL_ASM(libintl_bind_textdomain_codeset);
 +#endif
 +
++/* Specify the character encoding in which the messages from the
++   DOMAINNAME message catalog will be returned.  */
++#ifdef _INTL_REDIRECT_INLINE
++extern LIBINTL_DLL_EXPORTED char *libintl_bind_textdomain_codeset(const char *__domainname, const char *__codeset);
++static inline char *bind_textdomain_codeset(const char *__domainname, const char *__codeset)
++{
++    return libintl_bind_textdomain_codeset(__domainname, __codeset);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++#define bind_textdomain_codeset libintl_bind_textdomain_codeset
++#endif
++extern LIBINTL_DLL_EXPORTED char *bind_textdomain_codeset(const char *__domainname, const char *__codeset) _INTL_ASM(libintl_bind_textdomain_codeset);
++#endif
 +
++#endif /* IN_LIBGLOCALE */
 +
-+	/* Support for format strings with positions in *printf(), following the
-+	POSIX/XSI specification.
-+	Note: These replacements for the *printf() functions are visible only
-+	in source files that #include <libintl.h> or #include "gettext.h".
-+	Packages that use *printf() in source files that don't refer to _()
-+	or gettext() but for which the format string could be the return value
-+	of _() or gettext() need to add this #include.  Oh well.  */
++/* Support for format strings with positions in *printf(), following the
++   POSIX/XSI specification.
++   Note: These replacements for the *printf() functions are visible only
++   in source files that #include <libintl.h> or #include "gettext.h".
++   Packages that use *printf() in source files that don't refer to _()
++   or gettext() but for which the format string could be the return value
++   of _() or gettext() need to add this #include.  Oh well.  */
 +
-+#if !0
++#if !@HAVE_POSIX_PRINTF @
 +
-+#include <stdio.h>
 +#include <stddef.h>
++#include <stdio.h>
 +
-+	/* Get va_list.  */
-+#if __STDC__ || defined __cplusplus || defined _MSC_VER
-+# include <stdarg.h>
++/* Get va_list.  */
++#if (defined __STDC__ && __STDC__) || defined __cplusplus || defined _MSC_VER
++#include <stdarg.h>
 +#else
-+# include <varargs.h>
++#include <varargs.h>
 +#endif
 +
++#if !(defined fprintf && defined _GL_STDIO_H) /* don't override gnulib */
 +#undef fprintf
 +#define fprintf libintl_fprintf
-+	extern LIBINTL_DLL_EXPORTED int fprintf(FILE *, const char *, ...);
++extern LIBINTL_DLL_EXPORTED int fprintf(FILE *, const char *, ...);
++#endif
++#if !(defined vfprintf && defined _GL_STDIO_H) /* don't override gnulib */
 +#undef vfprintf
 +#define vfprintf libintl_vfprintf
-+	extern LIBINTL_DLL_EXPORTED int vfprintf(FILE *, const char *, va_list);
++extern LIBINTL_DLL_EXPORTED int vfprintf(FILE *, const char *, va_list);
++#endif
 +
++#if !(defined printf && defined _GL_STDIO_H) /* don't override gnulib */
 +#undef printf
 +#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__
-+	/* Don't break __attribute__((format(printf,M,N))).
-+	This redefinition is only possible because the libc in NetBSD, Cygwin,
-+	mingw does not have a function __printf__.  */
-+# define libintl_printf __printf__
++/* Don't break __attribute__((format(printf,M,N))).
++   This redefinition is only possible because the libc in NetBSD, Cygwin,
++   mingw does not have a function __printf__.
++   Alternatively, we could have done this redirection only when compiling with
++   __GNUC__, together with a symbol redirection:
++       extern LIBINTL_DLL_EXPORTED int printf (const char *, ...)
++              __asm__ (#__USER_LABEL_PREFIX__ "libintl_printf");
++   But doing it now would introduce a binary incompatibility with already
++   distributed versions of libintl on these systems.  */
++#define libintl_printf __printf__
 +#endif
 +#define printf libintl_printf
-+	extern LIBINTL_DLL_EXPORTED int printf(const char *, ...);
++extern LIBINTL_DLL_EXPORTED int printf(const char *, ...);
++#endif
++#if !(defined vprintf && defined _GL_STDIO_H) /* don't override gnulib */
 +#undef vprintf
 +#define vprintf libintl_vprintf
-+	extern LIBINTL_DLL_EXPORTED int vprintf(const char *, va_list);
++extern LIBINTL_DLL_EXPORTED int vprintf(const char *, va_list);
++#endif
 +
++#if !(defined sprintf && defined _GL_STDIO_H) /* don't override gnulib */
 +#undef sprintf
 +#define sprintf libintl_sprintf
-+	extern LIBINTL_DLL_EXPORTED int sprintf(char *, const char *, ...);
++extern LIBINTL_DLL_EXPORTED int sprintf(char *, const char *, ...);
++#endif
++#if !(defined vsprintf && defined _GL_STDIO_H) /* don't override gnulib */
 +#undef vsprintf
 +#define vsprintf libintl_vsprintf
-+	extern LIBINTL_DLL_EXPORTED int vsprintf(char *, const char *, va_list);
++extern LIBINTL_DLL_EXPORTED int vsprintf(char *, const char *, va_list);
++#endif
 +
-+#if 0
++#if @HAVE_SNPRINTF @
 +
++#if !(defined snprintf && defined _GL_STDIO_H) /* don't override gnulib */
 +#undef snprintf
 +#define snprintf libintl_snprintf
-+	extern LIBINTL_DLL_EXPORTED int snprintf(char *, size_t, const char *, ...);
++extern LIBINTL_DLL_EXPORTED int snprintf(char *, size_t, const char *, ...);
++#endif
++#if !(defined vsnprintf && defined _GL_STDIO_H) /* don't override gnulib */
 +#undef vsnprintf
 +#define vsnprintf libintl_vsnprintf
-+	extern LIBINTL_DLL_EXPORTED int vsnprintf(char *, size_t, const char *, va_list);
++extern LIBINTL_DLL_EXPORTED int vsnprintf(char *, size_t, const char *, va_list);
++#endif
 +
 +#endif
 +
-+#if 0
++#if @HAVE_ASPRINTF @
 +
++#if !(defined asprintf && defined _GL_STDIO_H) /* don't override gnulib */
 +#undef asprintf
 +#define asprintf libintl_asprintf
-+	extern LIBINTL_DLL_EXPORTED int asprintf(char **, const char *, ...);
++extern LIBINTL_DLL_EXPORTED int asprintf(char **, const char *, ...);
++#endif
++#if !(defined vasprintf && defined _GL_STDIO_H) /* don't override gnulib */
 +#undef vasprintf
 +#define vasprintf libintl_vasprintf
-+	extern LIBINTL_DLL_EXPORTED int vasprintf(char **, const char *, va_list);
++extern LIBINTL_DLL_EXPORTED int vasprintf(char **, const char *, va_list);
++#endif
 +
 +#endif
 +
-+#if 0
++#if @HAVE_WPRINTF @
 +
 +#undef fwprintf
 +#define fwprintf libintl_fwprintf
-+	extern LIBINTL_DLL_EXPORTED int fwprintf(FILE *, const wchar_t *, ...);
++extern LIBINTL_DLL_EXPORTED int fwprintf(FILE *, const wchar_t *, ...);
 +#undef vfwprintf
 +#define vfwprintf libintl_vfwprintf
-+	extern LIBINTL_DLL_EXPORTED int vfwprintf(FILE *, const wchar_t *, va_list);
++extern LIBINTL_DLL_EXPORTED int vfwprintf(FILE *, const wchar_t *, va_list);
 +
 +#undef wprintf
 +#define wprintf libintl_wprintf
-+	extern LIBINTL_DLL_EXPORTED int wprintf(const wchar_t *, ...);
++extern LIBINTL_DLL_EXPORTED int wprintf(const wchar_t *, ...);
 +#undef vwprintf
 +#define vwprintf libintl_vwprintf
-+	extern LIBINTL_DLL_EXPORTED int vwprintf(const wchar_t *, va_list);
++extern LIBINTL_DLL_EXPORTED int vwprintf(const wchar_t *, va_list);
 +
 +#undef swprintf
 +#define swprintf libintl_swprintf
-+	extern LIBINTL_DLL_EXPORTED int swprintf(wchar_t *, size_t, const wchar_t *, ...);
++extern LIBINTL_DLL_EXPORTED int swprintf(wchar_t *, size_t, const wchar_t *, ...);
 +#undef vswprintf
 +#define vswprintf libintl_vswprintf
-+	extern LIBINTL_DLL_EXPORTED int vswprintf(wchar_t *, size_t, const wchar_t *, va_list);
++extern LIBINTL_DLL_EXPORTED int vswprintf(wchar_t *, size_t, const wchar_t *, va_list);
 +
 +#endif
 +
 +#endif
 +
++/* Support for retrieving the name of a locale_t object.  */
++#if @HAVE_NAMELESS_LOCALES @
 +
-+	/* Support for relocatable packages.  */
++#ifndef GNULIB_defined_newlocale /* don't override gnulib */
++#undef newlocale
++#define newlocale libintl_newlocale
++extern locale_t newlocale(int, const char *, locale_t);
++#endif
 +
-+	/* Sets the original and the current installation prefix of the package.
-+	Relocation simply replaces a pathname starting with the original prefix
-+	by the corresponding pathname with the current prefix instead.  Both
-+	prefixes should be directory names without trailing slash (i.e. use ""
-+	instead of "/").  */
-+#define libintl_set_relocation_prefix libintl_set_relocation_prefix
-+	extern LIBINTL_DLL_EXPORTED void
-+		libintl_set_relocation_prefix(const char *orig_prefix,
-+			const char *curr_prefix);
++#ifndef GNULIB_defined_duplocale /* don't override gnulib */
++#undef duplocale
++#define duplocale libintl_duplocale
++extern locale_t duplocale(locale_t);
++#endif
 +
++#ifndef GNULIB_defined_freelocale /* don't override gnulib */
++#undef freelocale
++#define freelocale libintl_freelocale
++extern void freelocale(locale_t);
++#endif
++
++#endif
++
++/* Support for the locale chosen by the user.  */
++#if (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined __CYGWIN__
++
++#ifndef GNULIB_defined_setlocale /* don't override gnulib */
++#undef setlocale
++#define setlocale libintl_setlocale
++extern LIBINTL_DLL_EXPORTED char *setlocale(int, const char *);
++#endif
++
++#if @HAVE_NEWLOCALE @
++
++#undef newlocale
++#define newlocale libintl_newlocale
++/* Declare newlocale() only if the system headers define the 'locale_t' type. */
++#if !(defined __CYGWIN__ && !defined LC_ALL_MASK)
++extern locale_t newlocale(int, const char *, locale_t);
++#endif
++
++#endif
++
++#endif
++
++/* Support for relocatable packages.  */
++
++/* Sets the original and the current installation prefix of the package.
++   Relocation simply replaces a pathname starting with the original prefix
++   by the corresponding pathname with the current prefix instead.  Both
++   prefixes should be directory names without trailing slash (i.e. use ""
++   instead of "/").  */
++#define libintl_set_relocation_prefix libintl_set_relocation_prefix
++extern LIBINTL_DLL_EXPORTED void libintl_set_relocation_prefix(const char *orig_prefix, const char *curr_prefix);
 +
 +#ifdef __cplusplus
 +}
 +#endif
 +
 +#endif /* libintl.h */
-\ No newline at end of file
 diff --git a/gettext-runtime/intl/libintl.rc b/gettext-runtime/intl/libintl.rc
 deleted file mode 100644
-index 25224183..00000000
+index 2522418..0000000
 --- a/gettext-runtime/intl/libintl.rc
 +++ /dev/null
 @@ -1,38 +0,0 @@
@@ -2537,7 +2580,7 @@ index 25224183..00000000
 -END
 diff --git a/gettext-runtime/intl/libintl.rc.in b/gettext-runtime/intl/libintl.rc.in
 new file mode 100644
-index 00000000..f213dc64
+index 0000000..f213dc6
 --- /dev/null
 +++ b/gettext-runtime/intl/libintl.rc.in
 @@ -0,0 +1,38 @@
@@ -2580,5 +2623,5 @@ index 00000000..f213dc64
 +    END
 +END
 -- 
-2.30.0
+2.31.1.windows.1
 


More information about the kimageshop mailing list