OSDN Git Service

Initial version
authorSasaji <sasaji@s-sasaji.ddo.jp>
Sat, 17 Jan 2015 15:38:03 +0000 (00:38 +0900)
committerSasaji <sasaji@s-sasaji.ddo.jp>
Sat, 17 Jan 2015 15:38:03 +0000 (00:38 +0900)
113 files changed:
README.txt [new file with mode: 0644]
include/libintl.h [new file with mode: 0644]
include/wlibintl.h [new file with mode: 0644]
libintl/intl/00dir.txt [new file with mode: 0644]
libintl/libintl-0.19.4.patch [new file with mode: 0644]
libintl/libintl.vcproj [new file with mode: 0644]
libintl/libintl.vcxproj [new file with mode: 0644]
libintl/libintl.vcxproj.filters [new file with mode: 0644]
libintl/libintl_vc09.sln [new file with mode: 0644]
libintl/libintl_vc10.sln [new file with mode: 0644]
libintl/make_header.pl [new file with mode: 0644]
libintl/make_patch.pl [new file with mode: 0644]
libintl/msvc/bindtextdom-win.h [new file with mode: 0644]
libintl/msvc/config.h [new file with mode: 0644]
libintl/msvc/dcgettext-win.c [new file with mode: 0644]
libintl/msvc/dcigettext-win.c [new file with mode: 0644]
libintl/msvc/dcngettext-win.c [new file with mode: 0644]
libintl/msvc/debug.h [new file with mode: 0644]
libintl/msvc/dgettext-win.c [new file with mode: 0644]
libintl/msvc/dngettext-win.c [new file with mode: 0644]
libintl/msvc/gettext-win.c [new file with mode: 0644]
libintl/msvc/iconv.h [new file with mode: 0644]
libintl/msvc/libgnuintl.h [new file with mode: 0644]
libintl/msvc/loadmsgcat-win.h [new file with mode: 0644]
libintl/msvc/ngettext-win.c [new file with mode: 0644]
libintl/msvc/textdomain-win.c [new file with mode: 0644]
libintl/msvc/wcstombs-malloc.c [new file with mode: 0644]
libintl/msvc/win_iconv.c [new file with mode: 0644]
libintl/postbuild.bat [new file with mode: 0644]
libintl/prebuild.bat [new file with mode: 0644]
samples/copy_from_LC_MESSAGES.bat [new file with mode: 0644]
samples/copy_to_LC_MESSAGES.bat [new file with mode: 0644]
samples/get_lcid.cpp [new file with mode: 0644]
samples/get_lcid.h [new file with mode: 0644]
samples/gettext.h [new file with mode: 0644]
samples/locale/af/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/af/hello-c.mo [new file with mode: 0644]
samples/locale/ca/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/ca/hello-c.mo [new file with mode: 0644]
samples/locale/de/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/de/hello-c.mo [new file with mode: 0644]
samples/locale/el/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/el/hello-c.mo [new file with mode: 0644]
samples/locale/eo/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/eo/hello-c.mo [new file with mode: 0644]
samples/locale/es/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/es/hello-c.mo [new file with mode: 0644]
samples/locale/fi/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/fi/hello-c.mo [new file with mode: 0644]
samples/locale/fr/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/fr/hello-c.mo [new file with mode: 0644]
samples/locale/ga/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/ga/hello-c.mo [new file with mode: 0644]
samples/locale/hu/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/hu/hello-c.mo [new file with mode: 0644]
samples/locale/id/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/id/hello-c.mo [new file with mode: 0644]
samples/locale/it/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/it/hello-c.mo [new file with mode: 0644]
samples/locale/ja/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/ja/hello-c.mo [new file with mode: 0644]
samples/locale/ky/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/ky/hello-c.mo [new file with mode: 0644]
samples/locale/lv/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/lv/hello-c.mo [new file with mode: 0644]
samples/locale/ms/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/ms/hello-c.mo [new file with mode: 0644]
samples/locale/nl/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/nl/hello-c.mo [new file with mode: 0644]
samples/locale/pl/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/pl/hello-c.mo [new file with mode: 0644]
samples/locale/pt/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/pt/hello-c.mo [new file with mode: 0644]
samples/locale/ro/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/ro/hello-c.mo [new file with mode: 0644]
samples/locale/ru/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/ru/hello-c.mo [new file with mode: 0644]
samples/locale/sk/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/sk/hello-c.mo [new file with mode: 0644]
samples/locale/sl/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/sl/hello-c.mo [new file with mode: 0644]
samples/locale/sr/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/sr/hello-c.mo [new file with mode: 0644]
samples/locale/sv/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/sv/hello-c.mo [new file with mode: 0644]
samples/locale/tr/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/tr/hello-c.mo [new file with mode: 0644]
samples/locale/uk/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/uk/hello-c.mo [new file with mode: 0644]
samples/locale/vi/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/vi/hello-c.mo [new file with mode: 0644]
samples/locale/zh_CN/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/zh_CN/hello-c.mo [new file with mode: 0644]
samples/locale/zh_HK/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/zh_HK/hello-c.mo [new file with mode: 0644]
samples/locale/zh_TW/LC_MESSAGES/hello-c.mo [new file with mode: 0644]
samples/locale/zh_TW/hello-c.mo [new file with mode: 0644]
samples/sample-console/sample.cpp [new file with mode: 0644]
samples/sample-console/sample.vcproj [new file with mode: 0644]
samples/sample-console/sample.vcxproj [new file with mode: 0644]
samples/sample-console/sample.vcxproj.filters [new file with mode: 0644]
samples/sample-console/sample_vc09.sln [new file with mode: 0644]
samples/sample-console/sample_vc10.sln [new file with mode: 0644]
samples/sample-winapp/Resource.h [new file with mode: 0644]
samples/sample-winapp/sample-winapp.cpp [new file with mode: 0644]
samples/sample-winapp/sample-winapp.h [new file with mode: 0644]
samples/sample-winapp/sample-winapp.ico [new file with mode: 0644]
samples/sample-winapp/sample-winapp.rc [new file with mode: 0644]
samples/sample-winapp/sample-winapp.vcproj [new file with mode: 0644]
samples/sample-winapp/sample-winapp.vcxproj [new file with mode: 0644]
samples/sample-winapp/sample-winapp.vcxproj.filters [new file with mode: 0644]
samples/sample-winapp/sample-winapp_vc09.sln [new file with mode: 0644]
samples/sample-winapp/sample-winapp_vc10.sln [new file with mode: 0644]

diff --git a/README.txt b/README.txt
new file mode 100644 (file)
index 0000000..aad929d
--- /dev/null
@@ -0,0 +1,46 @@
+
+How to build:
+
+STEP 0: Preparation
+
+  Install Windows XP or higher.
+  Install Microsoft Visual C++ 2008 or 2010.
+  Install Microsoft SDK 7.1 (optional).
+  Install patch command, MinGW or TortoiseGit in order to patch source files.
+
+
+STEP 1: Getting the gettext archive
+
+  Download the gettext version 0.19.4
+  http://www.gnu.org/software/gettext/
+
+  Extract libintl sources.
+  copy to libintl/intl/ from gettext-runtime/intl/ on gettext archive.
+
+
+STEP 2: Patching source files
+
+  Patch libintl sources using patch command.
+
+  cd libintl/intl/; patch -p0 < ../patch-0.19.4.patch
+
+  Or, use TortoiseGitUDiff.
+
+
+STEP 3: Configure
+
+  Edit libintl/msvc/config.h if need.
+  Define SKIP_LC_MESSAGES to 1 if you don't need LC_MESSAGES sub-directory in locale directory.
+
+
+STEP 4: Building libraries using MSVC solution file
+
+  Build all using libintl_vc09.sln or libintl_vc10.sln.
+  On success, copy library files to lib/*.
+
+
+STEP 5: Testing
+
+  Build sample program on samples directory and test them.
+
+
diff --git a/include/libintl.h b/include/libintl.h
new file mode 100644 (file)
index 0000000..2b056c8
--- /dev/null
@@ -0,0 +1,342 @@
+/* Message catalogs for internationalization.
+   Copyright (C) 1995-1997, 2000-2012 Free Software Foundation, Inc.
+
+   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 Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBINTL_H
+#define _LIBINTL_H     1
+
+#include <locale.h>
+
+/* 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.  */
+#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun))
+# define LC_MESSAGES 1729
+#endif
+
+/* We define an additional symbol to signal that we use the GNU
+   implementation of gettext.  */
+#define __USE_GNU_GETTEXT 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)
+
+/* Resolve a platform specific conflict on DJGPP.  GNU gettext takes
+   precedence over _conio_gettext.  */
+#ifdef __DJGPP__
+# undef gettext
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Version number: (major<<16) + (minor<<8) + subminor */
+#define LIBINTL_VERSION 0x001304
+extern 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 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
+# 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
+#else
+# 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 defined __GNUC__ && __GNUC__ >= 3 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1 && defined __cplusplus)
+# define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n)))
+#else
+# 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).  */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_gettext (const char *__msgid)
+       _INTL_MAY_RETURN_STRING_ARG (1);
+static inline char *gettext (const char *__msgid)
+{
+  return libintl_gettext (__msgid);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define gettext libintl_gettext
+#endif
+extern 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.  */
+#ifdef _INTL_REDIRECT_INLINE
+extern 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);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define dgettext libintl_dgettext
+#endif
+extern 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.  */
+#ifdef _INTL_REDIRECT_INLINE
+extern 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);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define dcgettext libintl_dcgettext
+#endif
+extern 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.  */
+#ifdef _INTL_REDIRECT_INLINE
+extern 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);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define ngettext libintl_ngettext
+#endif
+extern 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.  */
+#ifdef _INTL_REDIRECT_INLINE
+extern 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);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define dngettext libintl_dngettext
+#endif
+extern 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.  */
+#ifdef _INTL_REDIRECT_INLINE
+extern 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);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define dcngettext libintl_dcngettext
+#endif
+extern 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
+
+
+
+/* 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 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
+#endif
+extern 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.  */
+#ifdef _INTL_REDIRECT_INLINE
+extern 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
+#endif
+extern 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.  */
+#ifdef _INTL_REDIRECT_INLINE
+extern 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 char *bind_textdomain_codeset (const char *__domainname,
+                                     const char *__codeset)
+       _INTL_ASM (libintl_bind_textdomain_codeset);
+#endif
+
+/* Do you worry about a memory leak problem at program end? */
+#ifdef _MSC_VER
+extern void libintl_freeres (void);
+#endif
+
+
+/* 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 the locale chosen by the user.  */
+#if (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
+
+#ifndef GNULIB_defined_setlocale /* don't override gnulib */
+#undef setlocale
+#define setlocale libintl_setlocale
+extern char *setlocale (int, const char *);
+#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 void
+       libintl_set_relocation_prefix (const char *orig_prefix,
+                                     const char *curr_prefix);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* libintl.h */
diff --git a/include/wlibintl.h b/include/wlibintl.h
new file mode 100644 (file)
index 0000000..238f762
--- /dev/null
@@ -0,0 +1,105 @@
+/* Message catalogs for internationalization. "wchar_t" support.
+
+   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 Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef WLIBINTL_H
+#define WLIBINTL_H     1
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/* wchar_t support */
+#ifdef _INTL_REDIRECT_INLINE
+#define WCHAR_LIBINTL_STATIC_INLINE static inline
+#elif defined(_MSC_VER)
+#define WCHAR_LIBINTL_STATIC_INLINE static _inline
+#else
+#define WCHAR_LIBINTL_STATIC_INLINE static
+#endif
+
+extern const wchar_t *libintl_wgettext (const wchar_t *wmsgid);
+WCHAR_LIBINTL_STATIC_INLINE 
+const wchar_t *wgettext (const wchar_t *wmsgid)
+{
+  return libintl_wgettext (wmsgid);
+}
+
+extern const wchar_t *libintl_dwgettext (const wchar_t *wdomainname, const wchar_t *wmsgid);
+WCHAR_LIBINTL_STATIC_INLINE 
+const wchar_t *dwgettext (const wchar_t *wdomainname, const wchar_t *wmsgid)
+{
+  return libintl_dwgettext (wdomainname, wmsgid);
+}
+
+extern const wchar_t *libintl_dcwgettext (const wchar_t *wdomainname, const wchar_t *wmsgid, int category);
+WCHAR_LIBINTL_STATIC_INLINE 
+const wchar_t *dcwgettext (const wchar_t *wdomainname, const wchar_t *wmsgid, int category)
+{
+  return libintl_dcwgettext (wdomainname, wmsgid, category);
+}
+
+extern const wchar_t *libintl_nwgettext (const wchar_t *wmsgid1, const wchar_t *wmsgid2, unsigned long int n);
+WCHAR_LIBINTL_STATIC_INLINE 
+const wchar_t *nwgettext (const wchar_t *wmsgid1, const wchar_t *wmsgid2, unsigned long int n)
+{
+  return libintl_nwgettext (wmsgid1, wmsgid2, n);
+}
+
+extern const wchar_t *libintl_dnwgettext (const wchar_t *wdomainname, const wchar_t *wmsgid1, const wchar_t *wmsgid2, unsigned long int n);
+WCHAR_LIBINTL_STATIC_INLINE 
+const wchar_t *dnwgettext (const wchar_t *wdomainname, const wchar_t *wmsgid1, const wchar_t *wmsgid2, unsigned long int n)
+{
+  return libintl_dnwgettext (wdomainname, wmsgid1, wmsgid2, n);
+}
+
+extern const wchar_t *libintl_dcnwgettext (const wchar_t *wdomainname, const wchar_t *wmsgid1, const wchar_t *wmsgid2, unsigned long int n, int category);
+WCHAR_LIBINTL_STATIC_INLINE 
+const wchar_t *dcnwgettext (const wchar_t *wdomainname, const wchar_t *wmsgid1, const wchar_t *wmsgid2, unsigned long int n, int category)
+{
+  return libintl_dcnwgettext (wdomainname, wmsgid1, wmsgid2, n, category);
+}
+
+extern const wchar_t *libintl_wbindtextdomain (const wchar_t *wdomainname, const wchar_t *wdirname);
+WCHAR_LIBINTL_STATIC_INLINE 
+const wchar_t *wbindtextdomain (const wchar_t *wdomainname, const wchar_t *wdirname)
+{
+  return libintl_wbindtextdomain (wdomainname, wdirname);
+}
+
+extern const wchar_t *libintl_wbind_textdomain_codeset (const wchar_t *wdomainname, const wchar_t *wcodeset);
+WCHAR_LIBINTL_STATIC_INLINE 
+const wchar_t *wbind_textdomain_codeset (const wchar_t *wdomainname, const wchar_t *wcodeset)
+{
+  return libintl_wbind_textdomain_codeset (wdomainname, wcodeset);
+}
+
+extern const wchar_t *libintl_wtextdomain (const wchar_t *wdomainname);
+WCHAR_LIBINTL_STATIC_INLINE 
+const wchar_t *wtextdomain (const wchar_t *wdomainname)
+{
+  return libintl_wtextdomain (wdomainname);
+}
+
+extern void libintl_wfreeres ();
+
+#undef WCHAR_LIBINTL_STATIC_INLINE 
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* wlibintl.h */
+
diff --git a/libintl/intl/00dir.txt b/libintl/intl/00dir.txt
new file mode 100644 (file)
index 0000000..b063de7
--- /dev/null
@@ -0,0 +1 @@
+Copy source files from gettext-runtime/intl/ on gettext archive.
diff --git a/libintl/libintl-0.19.4.patch b/libintl/libintl-0.19.4.patch
new file mode 100644 (file)
index 0000000..12d8c65
--- /dev/null
@@ -0,0 +1,621 @@
+--- bindtextdom.c      Thu Mar  7 17:44:37 2013
++++ bindtextdom.c      Fri Jan 16 23:48:50 2015
+@@ -66,6 +66,10 @@
+ # define BIND_TEXTDOMAIN_CODESET libintl_bind_textdomain_codeset
+ #endif
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ /* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP
+    to be used for the DOMAINNAME message catalog.
+    If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not
+@@ -335,4 +339,8 @@
+ /* Aliases for function names in GNU C Library.  */
+ weak_alias (__bindtextdomain, bindtextdomain);
+ weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset);
++#endif
++
++#ifdef _MSC_VER
++#include "bindtextdom-win.h"
+ #endif
+--- dcigettext.c       Tue Apr 15 10:52:10 2014
++++ dcigettext.c       Thu Jan 15 00:46:25 2015
+@@ -144,9 +144,14 @@
+ #  if VMS
+ #   define getcwd(buf, max) (getcwd) (buf, max, 0)
+ #  else
++#    if _MSC_VER
++#include <direct.h>
++#      define getcwd _getcwd
++#    else
+ char *getcwd ();
+ #  endif
+ # endif
++# endif
+ # ifndef HAVE_STPCPY
+ static char *stpcpy (char *dest, const char *src);
+ # endif
+@@ -164,6 +169,9 @@
+ # define tfind libintl_tfind
+ # define tdelete libintl_tdelete
+ # define twalk libintl_twalk
++#ifdef _MSC_VER
++# define tdestroy libintl_tdestroy
++#endif
+ # include "tsearch.h"
+ #endif
+@@ -410,6 +418,9 @@
+ # define freea(p) free (p)
+ #endif        /* have alloca */
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
+ #ifdef _LIBC
+ /* List of blocks allocated for translations.  */
+@@ -421,7 +432,10 @@
+ static struct transmem_list *transmem_list;
+ #else
+ typedef unsigned char transmem_block_t;
++#ifdef _MSC_VER
++static transmem_block_t *transmem_list = NULL;
+ #endif
++#endif
+ /* Names for the libintl functions are a problem.  They must not clash
+@@ -634,8 +648,11 @@
+         for (;;)
+           {
+             resolved_dirname = (char *) alloca (path_max + dirname_len);
++#ifndef _MSC_VER
+             ADD_BLOCK (block_list, tmp_dirname);
+-
++#else
++                ADD_BLOCK (block_list, resolved_dirname);
++#endif
+             __set_errno (0);
+             ret = getcwd (resolved_dirname, path_max);
+             if (ret != NULL || errno != ERANGE)
+@@ -672,9 +689,13 @@
+                                + domainname_len + 5);
+   ADD_BLOCK (block_list, xdomainname);
++#ifdef SKIP_LC_MESSAGES
++  stpcpy ((char *) mempcpy (xdomainname, domainname, domainname_len), ".mo");
++#else
+   stpcpy ((char *) mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),
+                           domainname, domainname_len),
+         ".mo");
++#endif
+   /* Creating working area.  */
+   single_locale = (char *) alloca (strlen (categoryvalue) + 1);
+@@ -1259,18 +1280,22 @@
+             const unsigned char *inbuf;
+             unsigned char *outbuf;
+             int malloc_count;
++#ifndef _MSC_VER
+ # ifndef _LIBC
+             transmem_block_t *transmem_list;
+ # endif
++#endif
+             __libc_lock_lock (lock);
+           not_translated_yet:
+             inbuf = (const unsigned char *) result;
+             outbuf = freemem + sizeof (size_t);
++#ifndef _MSC_VER
+ # ifndef _LIBC
+             transmem_list = NULL;
+ # endif
++#endif
+             malloc_count = 0;
+             while (1)
+@@ -1715,5 +1740,34 @@
+       transmem_list = transmem_list->next;
+       free (old);
+     }
++}
++#endif
++
++#ifdef _MSC_VER
++void libintl_freeres ()
++{
++  while (_nl_domain_bindings != NULL)
++    {
++      struct binding *oldp = _nl_domain_bindings;
++      _nl_domain_bindings = _nl_domain_bindings->next;
++      if (oldp->dirname != _nl_default_dirname)
++      /* Yes, this is a pointer comparison.  */
++      free (oldp->dirname);
++      free (oldp->codeset);
++
++      free (oldp);
++    }
++
++  if (_nl_current_default_domain != _nl_default_default_domain)
++    /* Yes, again a pointer comparison.  */
++    free ((char *) _nl_current_default_domain);
++
++  /* Remove the search tree with the known translations.  */
++  tdestroy (root, free);
++  root = NULL;
++
++  libintl_finddomain_subfreeres ();
++
++  free (transmem_list);
+ }
+ #endif
+--- finddomain.c       Thu Mar  7 17:44:37 2013
++++ finddomain.c       Thu Jan 15 00:52:48 2015
+@@ -46,6 +46,10 @@
+ # include "lock.h"
+ #endif
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ /* @@ end of prolog @@ */
+ /* List of already loaded domains.  */
+ static struct loaded_l10nfile *_nl_loaded_domains;
+@@ -202,6 +206,23 @@
+       struct loaded_l10nfile *here = runp;
+       if (runp->data != NULL)
+       _nl_unload_domain ((struct loaded_domain *) runp->data);
++      runp = runp->next;
++      free ((char *) here->filename);
++      free (here);
++    }
++}
++#endif
++
++#ifdef _MSC_VER
++void libintl_finddomain_subfreeres ()
++{
++  struct loaded_l10nfile *runp = _nl_loaded_domains;
++
++  while (runp != NULL)
++    {
++      struct loaded_l10nfile *here = runp;
++      if (runp->data != NULL)
++      libintl_unload_domain ((struct loaded_domain *) runp->data);
+       runp = runp->next;
+       free ((char *) here->filename);
+       free (here);
+--- gettextP.h Thu Mar  7 17:44:37 2013
++++ gettextP.h Wed Jan 14 17:17:25 2015
+@@ -304,6 +304,13 @@
+ /* Default text domain in which entries for gettext(3) are to be found.  */
+ extern const char *_nl_current_default_domain attribute_hidden;
++/* Do you worry about a memory leak problem at program end? */
++#ifdef _MSC_VER
++extern void libintl_freeres (void);
++extern void libintl_finddomain_subfreeres (void);
++extern void libintl_unload_domain (struct loaded_domain *__domain);
++#endif
++    
+ /* @@ begin of epilog @@ */
+ #endif /* gettextP.h  */
+--- l10nflist.c        Thu Mar  7 17:44:37 2013
++++ l10nflist.c        Wed Jan 14 17:17:25 2015
+@@ -45,6 +45,10 @@
+ # endif
+ #endif
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ /* @@ end of prolog @@ */
+ #ifdef _LIBC
+--- langprefs.c        Thu Mar  7 17:44:37 2013
++++ langprefs.c        Wed Jan 14 17:17:25 2015
+@@ -39,7 +39,14 @@
+ #ifdef WIN32_NATIVE
+ # define WIN32_LEAN_AND_MEAN
+ # include <windows.h>
++# ifdef _MSC_VER
++# include <tchar.h>
++# endif
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ # ifndef MUI_LANGUAGE_NAME
+ # define MUI_LANGUAGE_NAME 8
+ # endif
+@@ -205,7 +212,7 @@
+ /* Get the system's preference.  This can be used as a fallback.  */
+ static BOOL CALLBACK
+-ret_first_language (HMODULE h, LPCSTR type, LPCSTR name, WORD lang, LONG_PTR param)
++ret_first_language (HMODULE h, LPCTSTR type, LPCTSTR name, WORD lang, LONG_PTR param)
+ {
+   *(const char **)param = _nl_locale_name_from_win32_LANGID (lang);
+   return FALSE;
+@@ -327,7 +334,7 @@
+     if (!cache_initialized && getenv ("GETTEXT_MUI") != NULL)
+       {
+         const char *languages = NULL;
+-        HMODULE kernel32 = GetModuleHandle ("kernel32");
++        HMODULE kernel32 = GetModuleHandle (_T("kernel32"));
+         if (kernel32 != NULL)
+           languages = _nl_language_preferences_win32_mui (kernel32);
+--- loadmsgcat.c       Tue Dec  9 17:43:44 2014
++++ loadmsgcat.c       Fri Jan 16 23:30:06 2015
+@@ -31,6 +31,9 @@
+ #include <fcntl.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#ifdef _MSC_VER
++#include <io.h>
++#endif
+ #ifdef __GNUC__
+ # undef  alloca
+@@ -40,6 +43,7 @@
+ # ifdef _MSC_VER
+ #  include <malloc.h>
+ #  define alloca _alloca
++#  define freea  _freea
+ # else
+ #  if defined HAVE_ALLOCA_H || defined _LIBC
+ #   include <alloca.h>
+@@ -104,6 +108,10 @@
+ # define PRI_MACROS_BROKEN 0
+ #endif
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ /* Provide fallback values for macros that ought to be defined in <inttypes.h>.
+    Note that our fallback values need not be literal strings, because we don't
+    use them with preprocessor string concatenation.  */
+@@ -475,14 +483,19 @@
+   __mmap (addr, len, prot, flags, fd, offset)
+ # define munmap(addr, len)    __munmap (addr, len)
+ #endif
++#if (defined(WIN32) || defined(_WIN64) || defined(_WIN32_WCE) || defined(__CYGWIN__)) && (defined(UNICODE) || defined(_UNICODE))
++#include "loadmsgcat-win.h"
++#endif
+ /* For those losing systems which don't have `alloca' we have to add
+    some additional code emulating it.  */
+ #ifdef HAVE_ALLOCA
+ # define freea(p) /* nothing */
+ #else
++# ifndef _MSC_VER
+ # define alloca(n) malloc (n)
+ # define freea(p) free (p)
++# endif
+ #endif
+ /* For systems that distinguish between text and binary I/O.
+@@ -785,7 +798,7 @@
+ _nl_load_domain (struct loaded_l10nfile *domain_file,
+                struct binding *domainbinding)
+ {
+-  __libc_lock_define_initialized_recursive (static, lock);
++  __libc_lock_define_initialized_recursive (static, lock)
+   int fd = -1;
+   size_t size;
+ #ifdef _LIBC
+@@ -1336,6 +1349,40 @@
+     }
+   free (domain->conversions);
+   __libc_rwlock_fini (domain->conversions_lock);
++
++  free (domain->malloced);
++
++# ifdef _POSIX_MAPPED_FILES
++  if (domain->use_mmap)
++    munmap ((caddr_t) domain->data, domain->mmap_size);
++  else
++# endif       /* _POSIX_MAPPED_FILES */
++    free ((void *) domain->data);
++
++  free (domain);
++}
++#endif
++
++#ifdef _MSC_VER
++void libintl_unload_domain(struct loaded_domain *domain)
++{
++  size_t i;
++
++  if (domain->plural != &libintl_gettext_germanic_plural)
++    libintl_gettext_free_exp ((struct expression *) domain->plural);
++
++  for (i = 0; i < domain->nconversions; i++)
++    {
++      struct converted_domain *convd = &domain->conversions[i];
++
++      free ((char *) convd->encoding);
++      if (convd->conv_tab != NULL && convd->conv_tab != (char **) -1)
++      free (convd->conv_tab);
++      if (convd->conv != (iconv_t) -1)
++      iconv_close (convd->conv);
++    }
++  free (domain->conversions);
++  gl_rwlock_destroy (domain->conversions_lock);
+   free (domain->malloced);
+--- localcharset.c     Tue Dec  9 17:43:44 2014
++++ localcharset.c     Wed Jan 14 17:17:25 2015
+@@ -105,6 +105,10 @@
+ # define getc getc_unlocked
+ #endif
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ /* The following static variable is declared 'volatile' to avoid a
+    possible multithread problem in the function get_charset_aliases. If we
+    are running in a threaded environment, and if two threads initialize
+--- localealias.c      Thu Mar  7 17:44:37 2013
++++ localealias.c      Wed Jan 14 17:17:25 2015
+@@ -40,6 +40,7 @@
+ # ifdef _MSC_VER
+ #  include <malloc.h>
+ #  define alloca _alloca
++#  define freea  _freea
+ # else
+ #  if defined HAVE_ALLOCA_H || defined _LIBC
+ #   include <alloca.h>
+@@ -66,6 +67,10 @@
+ # define relocate(pathname) (pathname)
+ #endif
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ /* @@ end of prolog @@ */
+ #ifdef _LIBC
+@@ -106,8 +111,10 @@
+ #ifdef HAVE_ALLOCA
+ # define freea(p) /* nothing */
+ #else
++# ifndef _MSC_VER
+ # define alloca(n) malloc (n)
+ # define freea(p) free (p)
++# endif
+ #endif
+ #if defined _LIBC_REENTRANT || HAVE_DECL_FGETS_UNLOCKED
+--- localename.c       Tue Dec  9 17:43:44 2014
++++ localename.c       Wed Jan 14 17:17:25 2015
+@@ -60,6 +60,10 @@
+ # endif
+ #endif
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ #if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */
+ # define WIN32_LEAN_AND_MEAN
+ # include <windows.h>
+@@ -2518,17 +2522,17 @@
+ /* Callback function for EnumLocales.  */
+ static BOOL CALLBACK
+-enum_locales_fn (LPTSTR locale_num_str)
++enum_locales_fn (LPCSTR locale_num_str)
+ {
+   char *endp;
+   char locval[2 * LOCALE_NAME_MAX_LENGTH + 1 + 1];
+   LCID try_lcid = strtoul (locale_num_str, &endp, 16);
+-  if (GetLocaleInfo (try_lcid, LOCALE_SENGLANGUAGE,
++  if (GetLocaleInfoA (try_lcid, LOCALE_SENGLANGUAGE,
+                     locval, LOCALE_NAME_MAX_LENGTH))
+     {
+       strcat (locval, "_");
+-      if (GetLocaleInfo (try_lcid, LOCALE_SENGCOUNTRY,
++      if (GetLocaleInfoA (try_lcid, LOCALE_SENGCOUNTRY,
+                         locval + strlen (locval), LOCALE_NAME_MAX_LENGTH))
+        {
+          size_t locval_len = strlen (locval);
+@@ -2570,7 +2574,7 @@
+   strncpy (lname, locale_name, sizeof (lname) - 1);
+   lname[sizeof (lname) - 1] = '\0';
+   found_lcid = 0;
+-  EnumSystemLocales (enum_locales_fn, LCID_SUPPORTED);
++  EnumSystemLocalesA (enum_locales_fn, LCID_SUPPORTED);
+   if (found_lcid > 0)
+     {
+       last_lcid = found_lcid;
+--- log.c      Thu Mar  7 17:44:37 2013
++++ log.c      Wed Jan 14 17:17:25 2015
+@@ -31,6 +31,10 @@
+ # include "lock.h"
+ #endif
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ /* Separator between msgctxt and msgid in .mo files.  */
+ #define MSGCTXT_SEPARATOR '\004'  /* EOT */
+--- plural.c   Wed Dec 24 16:03:12 2014
++++ plural.c   Thu Jan 15 00:49:56 2015
+@@ -187,6 +187,10 @@
+ /* Copy the second part of user declarations.  */
+ #line 55 "plural.y" /* yacc.c:358  */
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ /* Prototypes for local functions.  */
+ static int yylex (YYSTYPE *lval, struct parse_args *arg);
+ static void yyerror (struct parse_args *arg, const char *str);
+--- plural.y   Thu Apr 24 12:41:48 2014
++++ plural.y   Wed Jan 14 18:08:02 2015
+@@ -53,6 +53,10 @@
+ }
+ %{
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ /* Prototypes for local functions.  */
+ static int yylex (YYSTYPE *lval, struct parse_args *arg);
+ static void yyerror (struct parse_args *arg, const char *str);
+--- printf-parse.c     Thu Mar  7 17:44:37 2013
++++ printf-parse.c     Wed Jan 14 17:17:25 2015
+@@ -76,6 +76,10 @@
+ # include "c-ctype.h"
+ #endif
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ #ifdef STATIC
+ STATIC
+ #endif
+--- printf.c   Thu Mar  7 17:44:37 2013
++++ printf.c   Wed Jan 14 17:17:25 2015
+@@ -43,6 +43,10 @@
+ #include <stdio.h>
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ #if !HAVE_POSIX_PRINTF
+ #include <errno.h>
+--- relocatable.c      Thu Mar  7 17:44:37 2013
++++ relocatable.c      Wed Jan 14 17:17:25 2015
+@@ -57,6 +57,10 @@
+ # include <libintl.h>
+ #endif
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ /* Faked cheap 'bool'.  */
+ #undef bool
+ #undef false
+--- setlocale.c        Tue Jan 28 18:04:40 2014
++++ setlocale.c        Wed Jan 14 17:17:25 2015
+@@ -42,6 +42,10 @@
+ #include "gettextP.h"
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ #if (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
+ # undef setlocale
+--- textdomain.c       Thu Mar  7 17:44:37 2013
++++ textdomain.c       Wed Jan 14 17:17:25 2015
+@@ -54,6 +54,10 @@
+ # define TEXTDOMAIN libintl_textdomain
+ #endif
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ /* Lock variable to protect the global data in the gettext implementation.  */
+ gl_rwlock_define (extern, _nl_state_lock attribute_hidden)
+--- tsearch.c  Thu Mar  7 17:44:37 2013
++++ tsearch.c  Thu Jan 15 00:54:57 2015
+@@ -97,14 +97,24 @@
+ typedef int (*__compar_fn_t) (const void *, const void *);
+ typedef void (*__action_fn_t) (const void *, VISIT, int);
++#ifdef _MSC_VER
++typedef void (*__free_fn_t) (void *);
++#endif
+ #ifndef weak_alias
+ # define __tsearch tsearch
+ # define __tfind tfind
+ # define __tdelete tdelete
+ # define __twalk twalk
++# ifdef _MSC_VER
++#  define __tdestroy tdestroy
++# endif
+ #endif
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ #ifndef internal_function
+ /* Inside GNU libc we mark some function in a special way.  In other
+    environments simply ignore the marking.  */
+@@ -650,7 +660,7 @@
+ #endif
+-#ifdef _LIBC
++#if defined(_LIBC) || defined(_MSC_VER) 
+ /* The standardized functions miss an important functionality: the
+    tree cannot be removed easily.  We provide a function to do this.  */
+@@ -677,6 +687,9 @@
+   if (root != NULL)
+     tdestroy_recurse (root, freefct);
+ }
++#endif /* _LIBC || _MSC_VER */
++
++#ifdef _LIBC
+ weak_alias (__tdestroy, tdestroy)
+ #endif /* _LIBC */
+--- tsearch.h  Thu Mar  7 17:44:37 2013
++++ tsearch.h  Wed Jan 14 17:17:25 2015
+@@ -72,6 +72,10 @@
+ extern void twalk (const void *vroot,
+                    void (*action) (const void *, VISIT, int));
++#ifdef _MSC_VER
++extern void tdestroy (void *vroot, void (*freefct)(void *));
++#endif
++
+ #ifdef __cplusplus
+ }
+ #endif
+--- vasnprintf.c       Tue Dec  9 17:43:44 2014
++++ vasnprintf.c       Wed Jan 14 17:17:25 2015
+@@ -118,6 +118,10 @@
+ # include "fpucw.h"
+ #endif
++#if defined(_MSC_VER) && defined(_DEBUG)
++#include <debug.h>
++#endif
++
+ /* Default parameters.  */
+ #ifndef VASNPRINTF
+ # if WIDE_CHAR_VERSION
diff --git a/libintl/libintl.vcproj b/libintl/libintl.vcproj
new file mode 100644 (file)
index 0000000..33e64f0
--- /dev/null
@@ -0,0 +1,737 @@
+<?xml version="1.0" encoding="shift_jis"?>
+<VisualStudioProject
+       ProjectType="Visual C++"
+       Version="9.00"
+       Name="libintl"
+       ProjectGUID="{510C612C-3B81-4568-BF86-D70B336F2C20}"
+       RootNamespace="libintl"
+       Keyword="Win32Proj"
+       TargetFrameworkVersion="196613"
+       >
+       <Platforms>
+               <Platform
+                       Name="Win32"
+               />
+               <Platform
+                       Name="x64"
+               />
+       </Platforms>
+       <ToolFiles>
+       </ToolFiles>
+       <Configurations>
+               <Configuration
+                       Name="Debug|Win32"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="4"
+                       CharacterSet="2"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                               CommandLine="prebuild.bat"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="msvc\;..\include\"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_LIB;HAVE_CONFIG_H"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="4"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLibrarianTool"
+                               OutputFile="$(OutDir)\$(ProjectName)d.lib"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                               CommandLine="postbuild.bat $(TargetPath) $(PlatformName)"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Debug|x64"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="4"
+                       CharacterSet="2"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                               CommandLine="prebuild.bat"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="msvc\;..\include\"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_LIB;HAVE_CONFIG_H"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLibrarianTool"
+                               OutputFile="$(OutDir)\$(ProjectName)d.lib"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                               CommandLine="postbuild.bat $(TargetPath) $(PlatformName)"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Release|Win32"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="4"
+                       CharacterSet="2"
+                       WholeProgramOptimization="0"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                               CommandLine="prebuild.bat"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="2"
+                               EnableIntrinsicFunctions="true"
+                               AdditionalIncludeDirectories="msvc\;..\include\"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;HAVE_CONFIG_H"
+                               RuntimeLibrary="2"
+                               EnableFunctionLevelLinking="true"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="0"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLibrarianTool"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                               CommandLine="postbuild.bat $(TargetPath) $(PlatformName)"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Release|x64"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="4"
+                       CharacterSet="2"
+                       WholeProgramOptimization="0"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                               CommandLine="prebuild.bat"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="2"
+                               EnableIntrinsicFunctions="true"
+                               AdditionalIncludeDirectories="msvc\;..\include\"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;HAVE_CONFIG_H"
+                               RuntimeLibrary="2"
+                               EnableFunctionLevelLinking="true"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="0"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLibrarianTool"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                               CommandLine="postbuild.bat $(TargetPath) $(PlatformName)"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Unicode_Debug|Win32"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="4"
+                       CharacterSet="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                               CommandLine="prebuild.bat"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="msvc\;..\include\"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_LIB;HAVE_CONFIG_H"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="4"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLibrarianTool"
+                               OutputFile="$(OutDir)\$(ProjectName)ud.lib"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                               CommandLine="postbuild.bat $(TargetPath) $(PlatformName)"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Unicode_Debug|x64"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="4"
+                       CharacterSet="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                               CommandLine="prebuild.bat"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="msvc\;..\include\"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_LIB;HAVE_CONFIG_H"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLibrarianTool"
+                               OutputFile="$(OutDir)\$(ProjectName)ud.lib"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                               CommandLine="postbuild.bat $(TargetPath) $(PlatformName)"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Unicode_Release|Win32"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="4"
+                       CharacterSet="1"
+                       WholeProgramOptimization="0"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                               CommandLine="prebuild.bat"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="2"
+                               EnableIntrinsicFunctions="true"
+                               AdditionalIncludeDirectories="msvc\;..\include\"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;HAVE_CONFIG_H"
+                               RuntimeLibrary="2"
+                               EnableFunctionLevelLinking="true"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="0"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLibrarianTool"
+                               OutputFile="$(OutDir)\$(ProjectName)u.lib"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                               CommandLine="postbuild.bat $(TargetPath) $(PlatformName)"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Unicode_Release|x64"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="4"
+                       CharacterSet="1"
+                       WholeProgramOptimization="0"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                               CommandLine="prebuild.bat"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="2"
+                               EnableIntrinsicFunctions="true"
+                               AdditionalIncludeDirectories="msvc\;..\include\"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_LIB;HAVE_CONFIG_H"
+                               RuntimeLibrary="2"
+                               EnableFunctionLevelLinking="true"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="0"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLibrarianTool"
+                               OutputFile="$(OutDir)\$(ProjectName)u.lib"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                               CommandLine="postbuild.bat $(TargetPath) $(PlatformName)"
+                       />
+               </Configuration>
+       </Configurations>
+       <References>
+       </References>
+       <Files>
+               <Filter
+                       Name="source files"
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+                       >
+                       <File
+                               RelativePath=".\intl\bindtextdom.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\msvc\dcgettext-win.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\dcgettext.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\msvc\dcigettext-win.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\dcigettext.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\msvc\dcngettext-win.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\dcngettext.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\msvc\dgettext-win.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\dgettext.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\msvc\dngettext-win.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\dngettext.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\explodename.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\finddomain.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\msvc\gettext-win.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\gettext.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\hash-string.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\intl-compat.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\l10nflist.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\langprefs.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\loadmsgcat.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\localcharset.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\localealias.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\localename.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\lock.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\log.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\msvc\ngettext-win.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\ngettext.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\osdep.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\plural-exp.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\plural.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\printf-args.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\printf-parse.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\printf.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\relocatable.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\setlocale.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\msvc\textdomain-win.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\textdomain.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\threadlib.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\tsearch.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\vasnprintf.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\version.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\msvc\wcstombs-malloc.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\msvc\win_iconv.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\intl\xsize.c"
+                               >
+                       </File>
+               </Filter>
+       </Files>
+       <Globals>
+       </Globals>
+</VisualStudioProject>
diff --git a/libintl/libintl.vcxproj b/libintl/libintl.vcxproj
new file mode 100644 (file)
index 0000000..2cf78d6
--- /dev/null
@@ -0,0 +1,463 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Unicode_Debug|Win32">
+      <Configuration>Unicode_Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Unicode_Debug|x64">
+      <Configuration>Unicode_Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Unicode_Release|Win32">
+      <Configuration>Unicode_Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Unicode_Release|x64">
+      <Configuration>Unicode_Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{78689712-24D9-4220-80B6-092524E56C56}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>libintl</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+    <TargetName>$(ProjectName)d</TargetName>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+    <TargetName>$(ProjectName)ud</TargetName>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <TargetName>$(ProjectName)d</TargetName>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <TargetName>$(ProjectName)ud</TargetName>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+    <TargetName>$(ProjectName)u</TargetName>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+    <TargetName>$(ProjectName)u</TargetName>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>msvc\;..\include\</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\</AdditionalLibraryDirectories>
+    </Link>
+    <PreBuildEvent>
+      <Command>prebuild.bat</Command>
+    </PreBuildEvent>
+    <PreBuildEvent>
+      <Message>
+      </Message>
+    </PreBuildEvent>
+    <PostBuildEvent>
+      <Command>postbuild.bat $(TargetPath) $(Platform)</Command>
+    </PostBuildEvent>
+    <Lib>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Lib>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>msvc\;..\include\</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\</AdditionalLibraryDirectories>
+    </Link>
+    <PreBuildEvent>
+      <Command>prebuild.bat</Command>
+    </PreBuildEvent>
+    <PreBuildEvent>
+      <Message>Compile yacc file using bison</Message>
+    </PreBuildEvent>
+    <PostBuildEvent>
+      <Command>postbuild.bat $(TargetPath) $(Platform)</Command>
+    </PostBuildEvent>
+    <Lib>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Lib>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>msvc\;..\include\</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\</AdditionalLibraryDirectories>
+    </Link>
+    <PreBuildEvent>
+      <Command>prebuild.bat</Command>
+    </PreBuildEvent>
+    <PreBuildEvent>
+      <Message>Compile yacc file using bison</Message>
+    </PreBuildEvent>
+    <PostBuildEvent>
+      <Command>postbuild.bat $(TargetPath) $(Platform)</Command>
+    </PostBuildEvent>
+    <Lib>
+      <TargetMachine>MachineX64</TargetMachine>
+    </Lib>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>msvc\;..\include\</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\</AdditionalLibraryDirectories>
+    </Link>
+    <PreBuildEvent>
+      <Command>prebuild.bat</Command>
+    </PreBuildEvent>
+    <PreBuildEvent>
+      <Message>Compile yacc file using bison</Message>
+    </PreBuildEvent>
+    <PostBuildEvent>
+      <Command>postbuild.bat $(TargetPath) $(Platform)</Command>
+    </PostBuildEvent>
+    <Lib>
+      <TargetMachine>MachineX64</TargetMachine>
+    </Lib>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>msvc\;..\include\</AdditionalIncludeDirectories>
+      <PrecompiledHeaderOutputFile>
+      </PrecompiledHeaderOutputFile>
+      <PrecompiledHeaderFile>
+      </PrecompiledHeaderFile>
+      <AssemblerListingLocation>
+      </AssemblerListingLocation>
+      <XMLDocumentationFileName>
+      </XMLDocumentationFileName>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <DebugInformationFormat>
+      </DebugInformationFormat>
+      <OmitFramePointers>true</OmitFramePointers>
+      <WholeProgramOptimization>false</WholeProgramOptimization>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\</AdditionalLibraryDirectories>
+    </Link>
+    <PreBuildEvent>
+      <Command>prebuild.bat</Command>
+    </PreBuildEvent>
+    <PreBuildEvent>
+      <Message>Compile yacc file using bison</Message>
+    </PreBuildEvent>
+    <PostBuildEvent>
+      <Command>postbuild.bat $(TargetPath) $(Platform)</Command>
+    </PostBuildEvent>
+    <Lib>
+      <TargetMachine>MachineX86</TargetMachine>
+      <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
+    </Lib>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>msvc\;..\include\</AdditionalIncludeDirectories>
+      <ProgramDataBaseFileName>
+      </ProgramDataBaseFileName>
+      <PrecompiledHeaderOutputFile>
+      </PrecompiledHeaderOutputFile>
+      <PrecompiledHeaderFile>
+      </PrecompiledHeaderFile>
+      <WholeProgramOptimization>false</WholeProgramOptimization>
+      <DebugInformationFormat>
+      </DebugInformationFormat>
+      <OmitFramePointers>true</OmitFramePointers>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\</AdditionalLibraryDirectories>
+    </Link>
+    <PreBuildEvent>
+      <Command>prebuild.bat</Command>
+    </PreBuildEvent>
+    <PreBuildEvent>
+      <Message>Compile yacc file using bison</Message>
+    </PreBuildEvent>
+    <PostBuildEvent>
+      <Command>postbuild.bat $(TargetPath) $(Platform)</Command>
+    </PostBuildEvent>
+    <Lib>
+      <TargetMachine>MachineX86</TargetMachine>
+      <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
+    </Lib>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>msvc\;..\include\</AdditionalIncludeDirectories>
+      <AssemblerListingLocation>
+      </AssemblerListingLocation>
+      <XMLDocumentationFileName>
+      </XMLDocumentationFileName>
+      <PrecompiledHeaderFile>
+      </PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>
+      </PrecompiledHeaderOutputFile>
+      <WholeProgramOptimization>false</WholeProgramOptimization>
+      <DebugInformationFormat>
+      </DebugInformationFormat>
+      <OmitFramePointers>true</OmitFramePointers>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\</AdditionalLibraryDirectories>
+    </Link>
+    <PreBuildEvent>
+      <Command>prebuild.bat</Command>
+    </PreBuildEvent>
+    <PreBuildEvent>
+      <Message>Compile yacc file using bison</Message>
+    </PreBuildEvent>
+    <PostBuildEvent>
+      <Command>postbuild.bat $(TargetPath) $(Platform)</Command>
+    </PostBuildEvent>
+    <Lib>
+      <TargetMachine>MachineX64</TargetMachine>
+      <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
+    </Lib>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>msvc\;..\include\</AdditionalIncludeDirectories>
+      <WholeProgramOptimization>false</WholeProgramOptimization>
+      <DebugInformationFormat>
+      </DebugInformationFormat>
+      <OmitFramePointers>true</OmitFramePointers>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\</AdditionalLibraryDirectories>
+    </Link>
+    <PreBuildEvent>
+      <Command>prebuild.bat</Command>
+    </PreBuildEvent>
+    <PreBuildEvent>
+      <Message>Compile yacc file using bison</Message>
+    </PreBuildEvent>
+    <PostBuildEvent>
+      <Command>postbuild.bat $(TargetPath) $(Platform)</Command>
+    </PostBuildEvent>
+    <Lib>
+      <TargetMachine>MachineX64</TargetMachine>
+      <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
+    </Lib>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="intl\bindtextdom.c" />
+    <ClCompile Include="intl\dcgettext.c" />
+    <ClCompile Include="intl\dcigettext.c" />
+    <ClCompile Include="intl\dcngettext.c" />
+    <ClCompile Include="intl\dgettext.c" />
+    <ClCompile Include="intl\dngettext.c" />
+    <ClCompile Include="intl\explodename.c" />
+    <ClCompile Include="intl\finddomain.c" />
+    <ClCompile Include="intl\gettext.c" />
+    <ClCompile Include="intl\hash-string.c" />
+    <ClCompile Include="intl\intl-compat.c" />
+    <ClCompile Include="intl\l10nflist.c" />
+    <ClCompile Include="intl\langprefs.c" />
+    <ClCompile Include="intl\loadmsgcat.c" />
+    <ClCompile Include="intl\localcharset.c" />
+    <ClCompile Include="intl\localealias.c" />
+    <ClCompile Include="intl\localename.c" />
+    <ClCompile Include="intl\lock.c" />
+    <ClCompile Include="intl\log.c" />
+    <ClCompile Include="intl\ngettext.c" />
+    <ClCompile Include="intl\osdep.c" />
+    <ClCompile Include="intl\plural-exp.c" />
+    <ClCompile Include="intl\plural.c" />
+    <ClCompile Include="intl\printf-args.c" />
+    <ClCompile Include="intl\printf-parse.c" />
+    <ClCompile Include="intl\printf.c" />
+    <ClCompile Include="intl\relocatable.c" />
+    <ClCompile Include="intl\setlocale.c" />
+    <ClCompile Include="intl\textdomain.c" />
+    <ClCompile Include="intl\threadlib.c" />
+    <ClCompile Include="intl\tsearch.c" />
+    <ClCompile Include="intl\vasnprintf.c" />
+    <ClCompile Include="intl\version.c" />
+    <ClCompile Include="intl\xsize.c" />
+    <ClCompile Include="msvc\dcigettext-win.c" />
+    <ClCompile Include="msvc\dcngettext-win.c" />
+    <ClCompile Include="msvc\dcgettext-win.c" />
+    <ClCompile Include="msvc\dgettext-win.c" />
+    <ClCompile Include="msvc\dngettext-win.c" />
+    <ClCompile Include="msvc\gettext-win.c" />
+    <ClCompile Include="msvc\ngettext-win.c" />
+    <ClCompile Include="msvc\textdomain-win.c" />
+    <ClCompile Include="msvc\wcstombs-malloc.c" />
+    <ClCompile Include="msvc\win_iconv.c" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/libintl/libintl.vcxproj.filters b/libintl/libintl.vcxproj.filters
new file mode 100644 (file)
index 0000000..b50b0a5
--- /dev/null
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="source files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="intl\bindtextdom.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\dcgettext.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\dcigettext.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\dcngettext.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\dgettext.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\dngettext.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\explodename.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\finddomain.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\gettext.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\hash-string.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\intl-compat.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\l10nflist.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\langprefs.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\loadmsgcat.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\localcharset.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\localealias.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\localename.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\lock.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\log.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\ngettext.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\osdep.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\plural.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\plural-exp.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\printf.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\printf-args.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\printf-parse.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\relocatable.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\setlocale.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\textdomain.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\threadlib.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\tsearch.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\vasnprintf.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\version.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="intl\xsize.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="msvc\dgettext-win.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="msvc\dcigettext-win.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="msvc\dcngettext-win.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="msvc\dcgettext-win.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="msvc\dngettext-win.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="msvc\gettext-win.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="msvc\ngettext-win.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="msvc\win_iconv.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="msvc\wcstombs-malloc.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+    <ClCompile Include="msvc\textdomain-win.c">
+      <Filter>source files</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/libintl/libintl_vc09.sln b/libintl/libintl_vc09.sln
new file mode 100644 (file)
index 0000000..57128b6
--- /dev/null
@@ -0,0 +1,38 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libintl", "libintl.vcproj", "{510C612C-3B81-4568-BF86-D70B336F2C20}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Debug|x64 = Debug|x64
+               Release|Win32 = Release|Win32
+               Release|x64 = Release|x64
+               Unicode_Debug|Win32 = Unicode_Debug|Win32
+               Unicode_Debug|x64 = Unicode_Debug|x64
+               Unicode_Release|Win32 = Unicode_Release|Win32
+               Unicode_Release|x64 = Unicode_Release|x64
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {510C612C-3B81-4568-BF86-D70B336F2C20}.Debug|Win32.ActiveCfg = Debug|Win32
+               {510C612C-3B81-4568-BF86-D70B336F2C20}.Debug|Win32.Build.0 = Debug|Win32
+               {510C612C-3B81-4568-BF86-D70B336F2C20}.Debug|x64.ActiveCfg = Debug|x64
+               {510C612C-3B81-4568-BF86-D70B336F2C20}.Debug|x64.Build.0 = Debug|x64
+               {510C612C-3B81-4568-BF86-D70B336F2C20}.Release|Win32.ActiveCfg = Release|Win32
+               {510C612C-3B81-4568-BF86-D70B336F2C20}.Release|Win32.Build.0 = Release|Win32
+               {510C612C-3B81-4568-BF86-D70B336F2C20}.Release|x64.ActiveCfg = Release|x64
+               {510C612C-3B81-4568-BF86-D70B336F2C20}.Release|x64.Build.0 = Release|x64
+               {510C612C-3B81-4568-BF86-D70B336F2C20}.Unicode_Debug|Win32.ActiveCfg = Unicode_Debug|Win32
+               {510C612C-3B81-4568-BF86-D70B336F2C20}.Unicode_Debug|Win32.Build.0 = Unicode_Debug|Win32
+               {510C612C-3B81-4568-BF86-D70B336F2C20}.Unicode_Debug|x64.ActiveCfg = Unicode_Debug|x64
+               {510C612C-3B81-4568-BF86-D70B336F2C20}.Unicode_Debug|x64.Build.0 = Unicode_Debug|x64
+               {510C612C-3B81-4568-BF86-D70B336F2C20}.Unicode_Release|Win32.ActiveCfg = Unicode_Release|Win32
+               {510C612C-3B81-4568-BF86-D70B336F2C20}.Unicode_Release|Win32.Build.0 = Unicode_Release|Win32
+               {510C612C-3B81-4568-BF86-D70B336F2C20}.Unicode_Release|x64.ActiveCfg = Unicode_Release|x64
+               {510C612C-3B81-4568-BF86-D70B336F2C20}.Unicode_Release|x64.Build.0 = Unicode_Release|x64
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/libintl/libintl_vc10.sln b/libintl/libintl_vc10.sln
new file mode 100644 (file)
index 0000000..d5b9a45
--- /dev/null
@@ -0,0 +1,38 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual C++ Express 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libintl", "libintl.vcxproj", "{78689712-24D9-4220-80B6-092524E56C56}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Debug|x64 = Debug|x64
+               Release|Win32 = Release|Win32
+               Release|x64 = Release|x64
+               Unicode_Debug|Win32 = Unicode_Debug|Win32
+               Unicode_Debug|x64 = Unicode_Debug|x64
+               Unicode_Release|Win32 = Unicode_Release|Win32
+               Unicode_Release|x64 = Unicode_Release|x64
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {78689712-24D9-4220-80B6-092524E56C56}.Debug|Win32.ActiveCfg = Debug|Win32
+               {78689712-24D9-4220-80B6-092524E56C56}.Debug|Win32.Build.0 = Debug|Win32
+               {78689712-24D9-4220-80B6-092524E56C56}.Debug|x64.ActiveCfg = Debug|x64
+               {78689712-24D9-4220-80B6-092524E56C56}.Debug|x64.Build.0 = Debug|x64
+               {78689712-24D9-4220-80B6-092524E56C56}.Release|Win32.ActiveCfg = Release|Win32
+               {78689712-24D9-4220-80B6-092524E56C56}.Release|Win32.Build.0 = Release|Win32
+               {78689712-24D9-4220-80B6-092524E56C56}.Release|x64.ActiveCfg = Release|x64
+               {78689712-24D9-4220-80B6-092524E56C56}.Release|x64.Build.0 = Release|x64
+               {78689712-24D9-4220-80B6-092524E56C56}.Unicode_Debug|Win32.ActiveCfg = Unicode_Debug|Win32
+               {78689712-24D9-4220-80B6-092524E56C56}.Unicode_Debug|Win32.Build.0 = Unicode_Debug|Win32
+               {78689712-24D9-4220-80B6-092524E56C56}.Unicode_Debug|x64.ActiveCfg = Unicode_Debug|x64
+               {78689712-24D9-4220-80B6-092524E56C56}.Unicode_Debug|x64.Build.0 = Unicode_Debug|x64
+               {78689712-24D9-4220-80B6-092524E56C56}.Unicode_Release|Win32.ActiveCfg = Unicode_Release|Win32
+               {78689712-24D9-4220-80B6-092524E56C56}.Unicode_Release|Win32.Build.0 = Unicode_Release|Win32
+               {78689712-24D9-4220-80B6-092524E56C56}.Unicode_Release|x64.ActiveCfg = Unicode_Release|x64
+               {78689712-24D9-4220-80B6-092524E56C56}.Unicode_Release|x64.Build.0 = Unicode_Release|x64
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/libintl/make_header.pl b/libintl/make_header.pl
new file mode 100644 (file)
index 0000000..a46921a
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/perl
+#
+# make libgnuintl.h for VC++
+#
+while (<>) {
+       s/\@HAVE_NEWLOCALE\@/0/g;
+       s/\@HAVE_POSIX_PRINTF\@/1/g;
+       s/\@HAVE_SNPRINTF\@/0/g;
+       s/\@HAVE_ASPRINTF\@/0/g;
+       s/\@HAVE_WPRINTF\@/0/g;
+       print;
+}
diff --git a/libintl/make_patch.pl b/libintl/make_patch.pl
new file mode 100644 (file)
index 0000000..7f951ce
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/perl
+#
+use Text::Diff 'diff';
+
+my $outfile="libintl-0.19.4.patch";
+
+unlink $outfile;
+
+my $orig_dir="intl.orig/";
+my $dest_dir="intl/";
+
+opendir(DIR, $dest_dir);
+my @dest_files = readdir(DIR);
+closedir(DIR);
+
+@orig_files = sort grep { /\.[chyl]$/; } @orig_files;
+@dest_files = sort grep { /\.[chyl]$/; } @dest_files;
+
+if (open(OUT, "> $outfile")) {
+       foreach my $dest_file (@dest_files) {
+               my $diff = diff($orig_dir.$dest_file, $dest_dir.$dest_file, { STYLE => "Unified" });
+
+               $diff =~ s/$orig_dir//g;
+               $diff =~ s/$dest_dir//g;
+
+               print OUT $diff;
+       }
+       close(OUT);
+}
+
diff --git a/libintl/msvc/bindtextdom-win.h b/libintl/msvc/bindtextdom-win.h
new file mode 100644 (file)
index 0000000..23e326b
--- /dev/null
@@ -0,0 +1,100 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the libintl for msvc.
+ * No warranty is given. You can use this at your own risk.
+ */
+/*
+  This file was created referring to Supplements for libintl on Windows.
+  http://sourceforge.net/projects/libintl-windows/
+*/
+
+#ifndef BINDTEXTDOM_WIN_H
+#define BINDTEXTDOM_WIN_H 1
+
+#include <windows.h>
+
+extern char *wcs_to_mbs_with_malloc(UINT acp, const wchar_t *wbuffer);
+extern wchar_t *mbs_to_wcs_with_malloc(UINT acp, const char *buffer);
+
+/**
+   This function is wchar_t version of bindtextdomain().
+   Specify that the DOMAINNAME message catalog will be found
+   in DIRNAME rather than in the system locale data base.  */
+wchar_t *
+libintl_wbindtextdomain (const wchar_t *wdomainname, const wchar_t *wdirname)
+{
+  char *domainname = NULL;
+  char *dirname = NULL;
+  char *dirname_bak = NULL;
+
+  domainname = wcs_to_mbs_with_malloc (CP_UTF8, wdomainname);
+  if (!domainname)
+    {
+      return NULL;
+    }
+
+  dirname = wcs_to_mbs_with_malloc (CP_UTF8, wdirname);
+  if (!dirname)
+    {
+      free (domainname);
+      return NULL;
+    }
+
+  dirname_bak = dirname;
+
+  set_binding_values (domainname, (const char**)&dirname, NULL);
+  if (!dirname)
+    {
+      free (dirname_bak);
+      free (domainname);
+      return NULL;
+    }
+
+  free (dirname_bak);
+  free (domainname);
+
+  return (wchar_t *) wdirname;
+}
+
+/**
+   This function is wchar_t version of bind_textdomain_codeset().
+   Specify the character encoding in which the messages from the
+   DOMAINNAME message catalog will be returned.  */
+wchar_t *
+libintl_wbind_textdomain_codeset (const wchar_t *wdomainname, const wchar_t *wcodeset)
+{
+  char *domainname = NULL;
+  char *codeset = NULL;
+  char *codeset_bak = NULL;
+
+  domainname = wcs_to_mbs_with_malloc (CP_UTF8, wdomainname);
+  if (!domainname)
+    {
+      return NULL;
+    }
+
+  codeset = wcs_to_mbs_with_malloc (CP_UTF8, wcodeset);
+  if (!codeset)
+    {
+      free (domainname);
+      return NULL;
+    }
+
+  codeset_bak = codeset;
+
+  set_binding_values (domainname, NULL, (const char**)&codeset);
+  if (!codeset)
+    {
+      free (codeset_bak);
+      free (domainname);
+      return NULL;
+    }
+
+  free (codeset_bak);
+  free (domainname);
+
+  return (wchar_t *) wcodeset;
+}
+
+#endif /* BINDTEXTDOM_WIN_H */
+
diff --git a/libintl/msvc/config.h b/libintl/msvc/config.h
new file mode 100644 (file)
index 0000000..0dbf8c6
--- /dev/null
@@ -0,0 +1,569 @@
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1400)
+#pragma warning( disable : 4819 )
+#pragma warning( disable : 4995 )
+#pragma warning( disable : 4996 )
+#endif
+
+#define IN_LIBINTL 1
+
+/* Define to 1 if you don't need LC_MESSAGES sub-directory in locale directory. */
+#define SKIP_LC_MESSAGES 1
+
+#ifndef LIBDIR
+#define LIBDIR .
+#endif
+#ifndef LOCALE_ALIAS_PATH
+#define LOCALE_ALIAS_PATH "alias"
+#endif
+#ifndef LOCALEDIR
+#define LOCALEDIR "locale"
+#endif
+#ifndef _POSIX_PATH_MAX
+#define _POSIX_PATH_MAX _MAX_PATH
+#endif
+
+/* Visual Studio 9.0 don't have <stdint.h> and some errno */
+#if _MSC_VER < 1600
+
+#define uintmax_t unsigned __int64 
+#define intmax_t __int64
+
+#ifndef EOVERFLOW
+#define EOVERFLOW 132
+#endif
+
+#endif
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+   systems. This function is required for `alloca.c' support on those systems.
+   */
+/* #undef CRAY_STACKSEG_END */
+
+/* Define to 1 if using `alloca.c'. */
+/* #undef C_ALLOCA */
+
+/* Define to 1 if translation of program messages to the user's native
+   language is requested. */
+#define ENABLE_NLS 1
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+/* #undef HAVE_ALLOCA */
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+   */
+/* #undef HAVE_ALLOCA_H */
+
+/* Define to 1 if you have the `argz_count' function. */
+/* #undef HAVE_ARGZ_COUNT */
+
+/* Define to 1 if you have the <argz.h> header file. */
+/* #undef HAVE_ARGZ_H */
+
+/* Define to 1 if you have the `argz_next' function. */
+/* #undef HAVE_ARGZ_NEXT */
+
+/* Define to 1 if you have the `argz_stringify' function. */
+/* #undef HAVE_ARGZ_STRINGIFY */
+
+/* Define to 1 if you have the `asprintf' function. */
+/* #undef HAVE_ASPRINTF */
+
+/* Define to 1 if the compiler understands __builtin_expect. */
+/* #undef HAVE_BUILTIN_EXPECT */
+
+/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the
+   CoreFoundation framework. */
+/* #undef HAVE_CFLOCALECOPYCURRENT */
+
+/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
+   the CoreFoundation framework. */
+/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+   */
+/* #undef HAVE_DCGETTEXT */
+
+/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you
+   don't. */
+#define HAVE_DECL_FEOF_UNLOCKED 0
+
+/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if
+   you don't. */
+#define HAVE_DECL_FGETS_UNLOCKED 0
+
+/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you
+   don't. */
+#define HAVE_DECL_GETC_UNLOCKED 0
+
+/* Define to 1 if you have the declaration of `_snprintf', and to 0 if you
+   don't. */
+#define HAVE_DECL__SNPRINTF 1
+
+/* Define to 1 if you have the declaration of `_snwprintf', and to 0 if you
+   don't. */
+#define HAVE_DECL__SNWPRINTF 1
+
+/* Define to 1 if you have the <features.h> header file. */
+/* #undef HAVE_FEATURES_H */
+
+/* Define to 1 if you have the `fwprintf' function. */
+/* #undef HAVE_FWPRINTF */
+
+/* Define to 1 if you have the `getcwd' function. */
+#define HAVE_GETCWD 1
+
+/* Define to 1 if you have the `getegid' function. */
+/* #undef HAVE_GETEGID */
+
+/* Define to 1 if you have the `geteuid' function. */
+/* #undef HAVE_GETEUID */
+
+/* Define to 1 if you have the `getgid' function. */
+/* #undef HAVE_GETGID */
+
+/* Define to 1 if you have the `getpagesize' function. */
+#define HAVE_GETPAGESIZE 1
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+/* #undef HAVE_GETTEXT */
+
+/* Define to 1 if you have the `getuid' function. */
+/* #undef HAVE_GETUID */
+
+/* Define if you have the iconv() function and it works. */
+#define HAVE_ICONV 1
+
+/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */
+#define HAVE_INTMAX_T 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+/* #undef HAVE_INTTYPES_H */
+
+/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and
+   declares uintmax_t. */
+/* #undef HAVE_INTTYPES_H_WITH_UINTMAX */
+
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+/* #undef HAVE_LANGINFO_CODESET */
+
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+/* #undef HAVE_LC_MESSAGES */
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if the system has the type 'long long int'. */
+#define HAVE_LONG_LONG_INT 1
+
+/* Define to 1 if you have the `mbrtowc' function. */
+#define HAVE_MBRTOWC 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `mempcpy' function. */
+/* #undef HAVE_MEMPCPY */
+
+/* Define to 1 if you have a working `mmap' system call. */
+/* #undef HAVE_MMAP */
+
+/* Define to 1 if you have the `munmap' function. */
+/* #undef HAVE_MUNMAP */
+
+/* Define to 1 if you have the `newlocale' function. */
+/* #undef HAVE_NEWLOCALE */
+
+/* Define if your printf() function supports format strings with positions. */
+#define HAVE_POSIX_PRINTF 1
+
+/* Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE. */
+/* #undef HAVE_PTHREAD_MUTEX_RECURSIVE */
+
+/* Define if the POSIX multithreading library has read/write locks. */
+/* #undef HAVE_PTHREAD_RWLOCK */
+
+/* Define to 1 if you have the `putenv' function. */
+#define HAVE_PUTENV 1
+
+/* Define to 1 if you have the `setenv' function. */
+/* #undef HAVE_SETENV */
+
+/* Define to 1 if you have the `setlocale' function. */
+#define HAVE_SETLOCALE 1
+
+/* Define to 1 if you have the `snprintf' function. */
+/* #undef HAVE_SNPRINTF */
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#if _MSC_VER >= 1600
+#define HAVE_STDINT_H 1
+#endif
+
+/* Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares
+   uintmax_t. */
+#if _MSC_VER >= 1600
+#define HAVE_STDINT_H_WITH_UINTMAX 1
+#endif
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `stpcpy' function. */
+/* #undef HAVE_STPCPY */
+
+/* Define to 1 if you have the `strcasecmp' function. */
+/* #undef HAVE_STRCASECMP */
+
+/* Define to 1 if you have the `strdup' function. */
+#define HAVE_STRDUP 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strnlen' function. */
+#define HAVE_STRNLEN 1
+
+/* Define to 1 if you have the `strtoul' function. */
+#define HAVE_STRTOUL 1
+
+/* Define to 1 if you have the `symlink' function. */
+/* #undef HAVE_SYMLINK */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+/* #undef HAVE_SYS_PARAM_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the `tsearch' function. */
+/* #undef HAVE_TSEARCH */
+
+/* Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>. */
+#define HAVE_UINTMAX_T 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+/* #undef HAVE_UNISTD_H */
+
+/* Define to 1 if the system has the type 'unsigned long long int'. */
+#define HAVE_UNSIGNED_LONG_LONG_INT 1
+
+/* Define to 1 if you have the `uselocale' function. */
+/* #undef HAVE_USELOCALE */
+
+/* Define to 1 or 0, depending whether the compiler supports simple visibility
+   declarations. */
+#define HAVE_VISIBILITY 1
+
+/* Define if you have the 'wchar_t' type. */
+#define HAVE_WCHAR_T 1
+
+/* Define to 1 if you have the `wcrtomb' function. */
+#define HAVE_WCRTOMB 1
+
+/* Define to 1 if you have the `wcslen' function. */
+#define HAVE_WCSLEN 1
+
+/* Define to 1 if you have the `wcsnlen' function. */
+#define HAVE_WCSNLEN 1
+
+/* Define if you have the 'wint_t' type. */
+#define HAVE_WINT_T 1
+
+/* Define to 1 if O_NOATIME works. */
+#define HAVE_WORKING_O_NOATIME 0
+
+/* Define to 1 if O_NOFOLLOW works. */
+#define HAVE_WORKING_O_NOFOLLOW 0
+
+/* Define to 1 if you have the `__fsetlocking' function. */
+/* #undef HAVE___FSETLOCKING */
+
+/* Define as const if the declaration of iconv() needs const. */
+#define ICONV_CONST const
+
+/* Define if integer division by zero raises signal SIGFPE. */
+#define INTDIV0_RAISES_SIGFPE 1
+
+/* Name of package */
+#define PACKAGE "libintl"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "bug-gnu-gettext@gnu.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "libintl"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "libintl 0.19.4"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "libintl"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "0.19.4"
+
+/* Define if <inttypes.h> exists and defines unusable PRI* macros. */
+/* #undef PRI_MACROS_BROKEN */
+
+/* Define if the pthread_in_use() detection is hard. */
+/* #undef PTHREAD_IN_USE_DETECTION_HARD */
+
+/* Define as the maximum value of type 'size_t', if the system doesn't define
+   it. */
+#ifndef SIZE_MAX
+/* # undef SIZE_MAX */
+#endif
+
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at runtime.
+       STACK_DIRECTION > 0 => grows toward higher addresses
+       STACK_DIRECTION < 0 => grows toward lower addresses
+       STACK_DIRECTION = 0 => direction of growth unknown */
+/* #undef STACK_DIRECTION */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define if the POSIX multithreading library can be used. */
+/* #undef USE_POSIX_THREADS */
+
+/* Define if references to the POSIX multithreading library should be made
+   weak. */
+/* #undef USE_POSIX_THREADS_WEAK */
+
+/* Define if the GNU Pth multithreading library can be used. */
+/* #undef USE_PTH_THREADS */
+
+/* Define if references to the GNU Pth multithreading library should be made
+   weak. */
+/* #undef USE_PTH_THREADS_WEAK */
+
+/* Define if the old Solaris multithreading library can be used. */
+/* #undef USE_SOLARIS_THREADS */
+
+/* Define if references to the old Solaris multithreading library should be
+   made weak. */
+/* #undef USE_SOLARIS_THREADS_WEAK */
+
+/* Enable extensions on AIX 3, Interix.  */
+#ifndef _ALL_SOURCE
+# define _ALL_SOURCE 1
+#endif
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# define _TANDEM_SOURCE 1
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__ 1
+#endif
+
+
+/* Define if the native Windows multithreading API can be used. */
+#define USE_WINDOWS_THREADS 1
+
+/* Version number of package */
+#define VERSION "0.19.4"
+
+/* Define to 1 if on MINIX. */
+/* #undef _MINIX */
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+/* #undef _POSIX_SOURCE */
+
+/* Please see the Gnulib manual for how to use these macros.
+
+   Suppress extern inline with HP-UX cc, as it appears to be broken; see
+   <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
+
+   Suppress extern inline with Sun C in standards-conformance mode, as it
+   mishandles inline functions that call each other.  E.g., for 'inline void f
+   (void) { } inline void g (void) { f (); }', c99 incorrectly complains
+   'reference to static identifier "f" in extern inline function'.
+   This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
+
+   Suppress extern inline (with or without __attribute__ ((__gnu_inline__)))
+   on configurations that mistakenly use 'static inline' to implement
+   functions or macros in standard C headers like <ctype.h>.  For example,
+   if isdigit is mistakenly implemented via a static inline function,
+   a program containing an extern inline function that calls isdigit
+   may not work since the C standard prohibits extern inline functions
+   from calling static functions.  This bug is known to occur on:
+
+     OS X 10.8 and earlier; see:
+     http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html
+
+     DragonFly; see
+     http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log
+
+     FreeBSD; see:
+     http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html
+
+   OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
+   for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.
+   Assume DragonFly and FreeBSD will be similar.  */
+#if (((defined __APPLE__ && defined __MACH__) \
+      || defined __DragonFly__ || defined __FreeBSD__) \
+     && (defined __header_inline \
+         ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
+            && ! defined __clang__) \
+         : ((! defined _DONT_USE_CTYPE_INLINE_ \
+             && (defined __GNUC__ || defined __cplusplus)) \
+            || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
+                && defined __GNUC__ && ! defined __cplusplus))))
+# define _GL_EXTERN_INLINE_STDHEADER_BUG
+#endif
+#if ((__GNUC__ \
+      ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+      : (199901L <= __STDC_VERSION__ \
+         && !defined __HP_cc \
+         && !(defined __SUNPRO_C && __STDC__))) \
+     && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
+# define _GL_INLINE inline
+# define _GL_EXTERN_INLINE extern inline
+# define _GL_EXTERN_INLINE_IN_USE
+#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
+       && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
+# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
+   /* __gnu_inline__ suppresses a GCC 4.2 diagnostic.  */
+#  define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
+# else
+#  define _GL_INLINE extern inline
+# endif
+# define _GL_EXTERN_INLINE extern
+# define _GL_EXTERN_INLINE_IN_USE
+#else
+# define _GL_INLINE static _GL_UNUSED
+# define _GL_EXTERN_INLINE static _GL_UNUSED
+#endif
+
+/* In GCC, suppress bogus "no previous prototype for 'FOO'"
+   and "no previous declaration for 'FOO'" diagnostics,
+   when FOO is an inline function in the header; see
+   <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and
+   <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>.  */
+#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
+#  define _GL_INLINE_HEADER_CONST_PRAGMA
+# else
+#  define _GL_INLINE_HEADER_CONST_PRAGMA \
+     _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
+# endif
+# define _GL_INLINE_HEADER_BEGIN \
+    _Pragma ("GCC diagnostic push") \
+    _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
+    _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
+    _GL_INLINE_HEADER_CONST_PRAGMA
+# define _GL_INLINE_HEADER_END \
+    _Pragma ("GCC diagnostic pop")
+#else
+# define _GL_INLINE_HEADER_BEGIN
+# define _GL_INLINE_HEADER_END
+#endif
+
+/* Define as a marker that can be attached to declarations that might not
+    be used.  This helps to reduce warnings, such as from
+    GCC -Wunused-parameter.  */
+#ifndef _GL_UNUSED
+# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+#  define _GL_UNUSED __attribute__ ((__unused__))
+# else
+#  define _GL_UNUSED
+# endif
+#endif
+
+/* The __pure__ attribute was added in gcc 2.96.  */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+#  define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+#  define _GL_ATTRIBUTE_PURE /* empty */
+# endif
+#endif
+
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+#define inline
+#endif
+
+/* Define as the type of the result of subtracting two pointers, if the system
+   doesn't define it. */
+/* #undef ptrdiff_t */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to unsigned long or unsigned long long if <stdint.h> and
+   <inttypes.h> don't define. */
+/* #undef uintmax_t */
+
+
+#define __libc_lock_t                   gl_lock_t
+#define __libc_lock_define              gl_lock_define
+#define __libc_lock_define_initialized  gl_lock_define_initialized
+#define __libc_lock_init                gl_lock_init
+#define __libc_lock_lock                gl_lock_lock
+#define __libc_lock_unlock              gl_lock_unlock
+#define __libc_lock_recursive_t                   gl_recursive_lock_t
+#define __libc_lock_define_recursive              gl_recursive_lock_define
+#define __libc_lock_define_initialized_recursive  gl_recursive_lock_define_initialized
+#define __libc_lock_init_recursive                gl_recursive_lock_init
+#define __libc_lock_lock_recursive                gl_recursive_lock_lock
+#define __libc_lock_unlock_recursive              gl_recursive_lock_unlock
+#define glthread_in_use  libintl_thread_in_use
+#define glthread_lock_init_func     libintl_lock_init_func
+#define glthread_lock_lock_func     libintl_lock_lock_func
+#define glthread_lock_unlock_func   libintl_lock_unlock_func
+#define glthread_lock_destroy_func  libintl_lock_destroy_func
+#define glthread_rwlock_init_multithreaded     libintl_rwlock_init_multithreaded
+#define glthread_rwlock_init_func              libintl_rwlock_init_func
+#define glthread_rwlock_rdlock_multithreaded   libintl_rwlock_rdlock_multithreaded
+#define glthread_rwlock_rdlock_func            libintl_rwlock_rdlock_func
+#define glthread_rwlock_wrlock_multithreaded   libintl_rwlock_wrlock_multithreaded
+#define glthread_rwlock_wrlock_func            libintl_rwlock_wrlock_func
+#define glthread_rwlock_unlock_multithreaded   libintl_rwlock_unlock_multithreaded
+#define glthread_rwlock_unlock_func            libintl_rwlock_unlock_func
+#define glthread_rwlock_destroy_multithreaded  libintl_rwlock_destroy_multithreaded
+#define glthread_rwlock_destroy_func           libintl_rwlock_destroy_func
+#define glthread_recursive_lock_init_multithreaded     libintl_recursive_lock_init_multithreaded
+#define glthread_recursive_lock_init_func              libintl_recursive_lock_init_func
+#define glthread_recursive_lock_lock_multithreaded     libintl_recursive_lock_lock_multithreaded
+#define glthread_recursive_lock_lock_func              libintl_recursive_lock_lock_func
+#define glthread_recursive_lock_unlock_multithreaded   libintl_recursive_lock_unlock_multithreaded
+#define glthread_recursive_lock_unlock_func            libintl_recursive_lock_unlock_func
+#define glthread_recursive_lock_destroy_multithreaded  libintl_recursive_lock_destroy_multithreaded
+#define glthread_recursive_lock_destroy_func           libintl_recursive_lock_destroy_func
+#define glthread_once_func            libintl_once_func
+#define glthread_once_singlethreaded  libintl_once_singlethreaded
+#define glthread_once_multithreaded   libintl_once_multithreaded
+
diff --git a/libintl/msvc/dcgettext-win.c b/libintl/msvc/dcgettext-win.c
new file mode 100644 (file)
index 0000000..5ee6e52
--- /dev/null
@@ -0,0 +1,25 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the libintl for msvc.
+ * No warranty is given. You can use this at your own risk.
+ */
+
+#include <windows.h>
+#include "config.h"
+#include "../intl/gettextP.h"
+
+#if defined(_MSC_VER) && defined(_DEBUG)
+#include <debug.h>
+#endif
+
+extern const wchar_t *libintl_dciwgettext (const wchar_t *wdomainname, const wchar_t *wmsgid1, const wchar_t *wmsgid2,
+           int plural, unsigned long int n, int category);
+
+/**
+   This function is wchar_t version of dcgettext().
+   Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+   locale.  */
+const wchar_t *libintl_dcwgettext (const wchar_t *wdomainname, const wchar_t *wmsgid, int category)
+{
+  return libintl_dciwgettext (wdomainname, wmsgid, NULL, 0, 0, category);
+}
diff --git a/libintl/msvc/dcigettext-win.c b/libintl/msvc/dcigettext-win.c
new file mode 100644 (file)
index 0000000..35746c1
--- /dev/null
@@ -0,0 +1,92 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the libintl for msvc.
+ * No warranty is given. You can use this at your own risk.
+ */
+
+#include <windows.h>
+#include "config.h"
+#include "../intl/gettextP.h"
+
+#if defined(_MSC_VER) && defined(_DEBUG)
+#include <debug.h>
+#endif
+
+extern char *wcs_to_mbs_with_malloc(UINT acp, const wchar_t *wbuffer);
+extern void libintl_wtextdomain_freeres ();
+
+/**
+   This function is wchar_t version of dcigettext().
+   Look up MSGID in the DOMAINNAME message catalog for the current
+   CATEGORY locale and, if PLURAL is nonzero, search over string
+   depending on the plural form determined by N.  */
+const wchar_t *libintl_dciwgettext (const wchar_t *wdomainname, const wchar_t *wmsgid1, const wchar_t *wmsgid2,
+           int plural, unsigned long int n, int category)
+{
+  char *domainname = NULL;
+  char *msgid1 = NULL;
+  char *msgid2 = NULL;
+  char *translated = NULL;
+  const wchar_t *retval = NULL;
+
+  if (wmsgid1 == NULL)
+    {
+      goto end;
+    }
+
+  if (wdomainname != NULL)
+    {
+      domainname = wcs_to_mbs_with_malloc(CP_UTF8, wdomainname);
+      if (domainname == NULL)
+        {
+          goto end;
+        }
+    }
+
+  msgid1 = wcs_to_mbs_with_malloc(CP_UTF8, wmsgid1);
+  if (msgid1 == NULL)
+    {
+      goto end;
+    }
+
+  if (wmsgid2 != NULL)
+    {
+      msgid2 = wcs_to_mbs_with_malloc(CP_UTF8, wmsgid2);
+      if (msgid2 == NULL)
+        {
+          goto end;
+        }
+    }
+
+  translated = libintl_dcigettext(domainname, msgid1, msgid2, plural, n, category);
+  if (translated == msgid1)
+    {
+      retval = wmsgid1;
+      goto end;
+    }
+  if (translated == msgid2)
+    {
+      retval = wmsgid2;
+      goto end;
+    }
+
+  retval = (const wchar_t *) translated;
+
+end:
+  free (domainname);
+  free (msgid1);
+  free (msgid2);
+  return retval;
+}
+
+/**
+   If you use wgettext, call this instead of libintl_freeres().
+   If we want to free all resources we have to do some work at
+   program's end.
+ */
+void
+libintl_wfreeres ()
+{
+  libintl_freeres();
+  libintl_wtextdomain_freeres();
+}
diff --git a/libintl/msvc/dcngettext-win.c b/libintl/msvc/dcngettext-win.c
new file mode 100644 (file)
index 0000000..f4d1f9f
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the libintl for msvc.
+ * No warranty is given. You can use this at your own risk.
+ */
+
+#include <windows.h>
+#include "config.h"
+#include "../intl/gettextP.h"
+
+#if defined(_MSC_VER) && defined(_DEBUG)
+#include <debug.h>
+#endif
+
+extern const wchar_t *libintl_dciwgettext (const char *domainname, const wchar_t *wmsgid1, const wchar_t *wmsgid2,
+           int plural, unsigned long int n, int category);
+
+/**
+   This function is wchar_t version of dcngettext().
+   Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+   locale.  */
+const wchar_t *libintl_dcnwgettext (const char *domainname,
+           const wchar_t *wmsgid1, const wchar_t *wmsgid2, unsigned long int n,
+           int category)
+{
+  return libintl_dciwgettext (domainname, wmsgid1, wmsgid2, 1, n, category);
+}
diff --git a/libintl/msvc/debug.h b/libintl/msvc/debug.h
new file mode 100644 (file)
index 0000000..66aa83a
--- /dev/null
@@ -0,0 +1,20 @@
+
+#ifdef _DEBUG
+
+#ifndef _DEBUG_H_
+#define _DEBUG_H_
+
+#undef _malloca
+#undef getcwd
+#undef alloca
+
+#define _CRTDBG_MAP_ALLOC
+#include <crtdbg.h>
+
+#define alloca(x)     _malloca_dbg(x, _NORMAL_BLOCK, __FILE__, __LINE__)
+#define _alloca(x)    _malloca_dbg(x, _NORMAL_BLOCK, __FILE__, __LINE__)
+
+#endif
+
+#endif
+
diff --git a/libintl/msvc/dgettext-win.c b/libintl/msvc/dgettext-win.c
new file mode 100644 (file)
index 0000000..370713b
--- /dev/null
@@ -0,0 +1,24 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the libintl for msvc.
+ * No warranty is given. You can use this at your own risk.
+ */
+
+#include <windows.h>
+#include "config.h"
+#include "../intl/gettextP.h"
+
+#if defined(_MSC_VER) && defined(_DEBUG)
+#include <debug.h>
+#endif
+
+extern const wchar_t *libintl_dcwgettext (const char *domainname, const wchar_t *wmsgid, int category);
+
+/**
+   This function is wchar_t version of dgettext().
+   Look up MSGID in the DOMAINNAME message catalog of the current
+   LC_MESSAGES locale.  */
+const wchar_t *libintl_dwgettext (const char *domainname, const wchar_t *wmsgid)
+{
+  return libintl_dcwgettext (domainname, wmsgid, LC_MESSAGES);
+}
diff --git a/libintl/msvc/dngettext-win.c b/libintl/msvc/dngettext-win.c
new file mode 100644 (file)
index 0000000..6542edb
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the libintl for msvc.
+ * No warranty is given. You can use this at your own risk.
+ */
+
+#include <windows.h>
+#include "config.h"
+#include "../intl/gettextP.h"
+
+#if defined(_MSC_VER) && defined(_DEBUG)
+#include <debug.h>
+#endif
+
+extern const wchar_t *libintl_dcnwgettext (const char *domainname,
+           const wchar_t *wmsgid1, const wchar_t *wmsgid2, unsigned long int n,
+           int category);
+
+/**
+   This function is wchar_t version of dngettext().
+   Look up MSGID in the DOMAINNAME message catalog of the current
+   LC_MESSAGES locale and skip message according to the plural form.  */
+const wchar_t *libintl_dnwgettext (const char *domainname,
+          const wchar_t *wmsgid1, const wchar_t *wmsgid2, unsigned long int n)
+{
+  return libintl_dcnwgettext (domainname, wmsgid1, wmsgid2, n, LC_MESSAGES);
+}
diff --git a/libintl/msvc/gettext-win.c b/libintl/msvc/gettext-win.c
new file mode 100644 (file)
index 0000000..b9858fd
--- /dev/null
@@ -0,0 +1,25 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the libintl for msvc.
+ * No warranty is given. You can use this at your own risk.
+ */
+
+#include <windows.h>
+#include "config.h"
+#include "../intl/gettextP.h"
+
+#if defined(_MSC_VER) && defined(_DEBUG)
+#include <debug.h>
+#endif
+
+extern const wchar_t *libintl_dcwgettext (const char *domainname, const wchar_t *wmsgid, int category);
+
+/**
+   This function is wchar_t version of gettext().
+   Look up MSGID in the current default message catalog for the current
+   LC_MESSAGES locale.  If not found, returns MSGID itself (the default
+   text).  */
+const wchar_t *libintl_wgettext (const wchar_t *wmsgid)
+{
+  return libintl_dcwgettext (NULL, wmsgid, LC_MESSAGES);
+}
diff --git a/libintl/msvc/iconv.h b/libintl/msvc/iconv.h
new file mode 100644 (file)
index 0000000..ea71ac2
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef _LIBICONV_H
+#define _LIBICONV_H
+#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef void* iconv_t;
+iconv_t iconv_open(const char *tocode, const char *fromcode);
+int iconv_close(iconv_t cd);
+size_t iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
+#ifdef __cplusplus
+}
+#endif
+#endif//_LIBICONV_H
diff --git a/libintl/msvc/libgnuintl.h b/libintl/msvc/libgnuintl.h
new file mode 100644 (file)
index 0000000..a3bdc5e
--- /dev/null
@@ -0,0 +1,466 @@
+/* Message catalogs for internationalization.
+   Copyright (C) 1995-1997, 2000-2012 Free Software Foundation, Inc.
+
+   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 Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBINTL_H
+#define _LIBINTL_H 1
+
+#include <locale.h>
+#if (defined __APPLE__ && defined __MACH__) && 0
+# 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.  */
+#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun))
+# define LC_MESSAGES 1729
+#endif
+
+/* We define an additional symbol to signal that we use the GNU
+   implementation of gettext.  */
+#define __USE_GNU_GETTEXT 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)
+
+/* Resolve a platform specific conflict on DJGPP.  GNU gettext takes
+   precedence over _conio_gettext.  */
+#ifdef __DJGPP__
+# undef gettext
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Version number: (major<<16) + (minor<<8) + subminor */
+#define LIBINTL_VERSION 0x001304
+extern 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 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
+# 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
+#else
+# 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 defined __GNUC__ && __GNUC__ >= 3 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1 && defined __cplusplus)
+# define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n)))
+#else
+# 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).  */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_gettext (const char *__msgid)
+       _INTL_MAY_RETURN_STRING_ARG (1);
+static inline char *gettext (const char *__msgid)
+{
+  return libintl_gettext (__msgid);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define gettext libintl_gettext
+#endif
+extern 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.  */
+#ifdef _INTL_REDIRECT_INLINE
+extern 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);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define dgettext libintl_dgettext
+#endif
+extern 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.  */
+#ifdef _INTL_REDIRECT_INLINE
+extern 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);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define dcgettext libintl_dcgettext
+#endif
+extern 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.  */
+#ifdef _INTL_REDIRECT_INLINE
+extern 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);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define ngettext libintl_ngettext
+#endif
+extern 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.  */
+#ifdef _INTL_REDIRECT_INLINE
+extern 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);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define dngettext libintl_dngettext
+#endif
+extern 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.  */
+#ifdef _INTL_REDIRECT_INLINE
+extern 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);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define dcngettext libintl_dcngettext
+#endif
+extern 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".  */
+#ifdef _INTL_REDIRECT_INLINE
+extern 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
+#endif
+extern 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.  */
+#ifdef _INTL_REDIRECT_INLINE
+extern 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
+#endif
+extern 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.  */
+#ifdef _INTL_REDIRECT_INLINE
+extern 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 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.  */
+
+#if !1
+
+#include <stdio.h>
+#include <stddef.h>
+
+/* Get va_list.  */
+#if (defined __STDC__ && __STDC__) || defined __cplusplus || defined _MSC_VER
+# include <stdarg.h>
+#else
+# include <varargs.h>
+#endif
+
+#if !(defined fprintf && defined _GL_STDIO_H) /* don't override gnulib */
+#undef fprintf
+#define fprintf libintl_fprintf
+extern int fprintf (FILE *, const char *, ...);
+#endif
+#if !(defined vfprintf && defined _GL_STDIO_H) /* don't override gnulib */
+#undef vfprintf
+#define vfprintf libintl_vfprintf
+extern 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__.
+   Alternatively, we could have done this redirection only when compiling with
+   __GNUC__, together with a symbol redirection:
+       extern 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 int printf (const char *, ...);
+#endif
+#if !(defined vprintf && defined _GL_STDIO_H) /* don't override gnulib */
+#undef vprintf
+#define vprintf libintl_vprintf
+extern 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 int sprintf (char *, const char *, ...);
+#endif
+#if !(defined vsprintf && defined _GL_STDIO_H) /* don't override gnulib */
+#undef vsprintf
+#define vsprintf libintl_vsprintf
+extern int vsprintf (char *, const char *, va_list);
+#endif
+
+#if 0
+
+#if !(defined snprintf && defined _GL_STDIO_H) /* don't override gnulib */
+#undef snprintf
+#define snprintf libintl_snprintf
+extern 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 int vsnprintf (char *, size_t, const char *, va_list);
+#endif
+
+#endif
+
+#if 0
+
+#if !(defined asprintf && defined _GL_STDIO_H) /* don't override gnulib */
+#undef asprintf
+#define asprintf libintl_asprintf
+extern int asprintf (char **, const char *, ...);
+#endif
+#if !(defined vasprintf && defined _GL_STDIO_H) /* don't override gnulib */
+#undef vasprintf
+#define vasprintf libintl_vasprintf
+extern int vasprintf (char **, const char *, va_list);
+#endif
+
+#endif
+
+#if 0
+
+#undef fwprintf
+#define fwprintf libintl_fwprintf
+extern int fwprintf (FILE *, const wchar_t *, ...);
+#undef vfwprintf
+#define vfwprintf libintl_vfwprintf
+extern int vfwprintf (FILE *, const wchar_t *, va_list);
+
+#undef wprintf
+#define wprintf libintl_wprintf
+extern int wprintf (const wchar_t *, ...);
+#undef vwprintf
+#define vwprintf libintl_vwprintf
+extern int vwprintf (const wchar_t *, va_list);
+
+#undef swprintf
+#define swprintf libintl_swprintf
+extern int swprintf (wchar_t *, size_t, const wchar_t *, ...);
+#undef vswprintf
+#define vswprintf libintl_vswprintf
+extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);
+
+#endif
+
+#endif
+
+
+/* Support for the locale chosen by the user.  */
+#if (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
+
+#ifndef GNULIB_defined_setlocale /* don't override gnulib */
+#undef setlocale
+#define setlocale libintl_setlocale
+extern char *setlocale (int, const char *);
+#endif
+
+#if 0
+
+#undef newlocale
+#define newlocale libintl_newlocale
+extern locale_t newlocale (int, const char *, locale_t);
+
+#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 void
+       libintl_set_relocation_prefix (const char *orig_prefix,
+                                      const char *curr_prefix);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* libintl.h */
diff --git a/libintl/msvc/loadmsgcat-win.h b/libintl/msvc/loadmsgcat-win.h
new file mode 100644 (file)
index 0000000..ea605f6
--- /dev/null
@@ -0,0 +1,46 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the libintl for msvc.
+ * No warranty is given. You can use this at your own risk.
+ */
+/*
+  This file was created referring to Supplements for libintl on Windows.
+  http://sourceforge.net/projects/libintl-windows/
+*/
+
+#ifndef LOADMSGCAT_WINDOWS_H
+#define LOADMSGCAT_WINDOWS_H 1
+
+#include <windows.h>
+#include <io.h>
+
+extern wchar_t *mbs_to_wcs_with_malloc(UINT acp, const char *buffer);
+
+int
+open_windows_utf8 (const char *pathname8, int flags)
+{
+  wchar_t *pathname16 = NULL;
+  int result = 0;
+
+  if (!pathname8)
+    {
+      errno = EFAULT;
+      return -1;
+    }
+
+  pathname16 = mbs_to_wcs_with_malloc (CP_UTF8, pathname8);
+  if (!pathname16)
+    {
+      return -1;
+    }
+
+  result = _wopen (pathname16, flags);
+  free (pathname16);
+  return result;
+}
+
+#undef open
+#define open(name, flags) open_windows_utf8(name, flags)
+
+#endif
+
diff --git a/libintl/msvc/ngettext-win.c b/libintl/msvc/ngettext-win.c
new file mode 100644 (file)
index 0000000..05f87e9
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the libintl for msvc.
+ * No warranty is given. You can use this at your own risk.
+ */
+
+#include <windows.h>
+#include "config.h"
+#include "../intl/gettextP.h"
+
+#if defined(_MSC_VER) && defined(_DEBUG)
+#include <debug.h>
+#endif
+
+extern const wchar_t *libintl_dcnwgettext (const char *domainname,
+           const wchar_t *wmsgid1, const wchar_t *wmsgid2, unsigned long int n,
+           int category);
+
+/**
+   This function is wchar_t version of ngettext().
+   Look up MSGID in the current default message catalog for the current
+   LC_MESSAGES locale.  If not found, returns MSGID itself (the default
+   text).  */
+const wchar_t *libintl_nwgettext (const wchar_t *wmsgid1, const wchar_t *wmsgid2, unsigned long int n)
+{
+  return libintl_dcnwgettext (NULL, wmsgid1, wmsgid2, n, LC_MESSAGES);
+}
diff --git a/libintl/msvc/textdomain-win.c b/libintl/msvc/textdomain-win.c
new file mode 100644 (file)
index 0000000..5362067
--- /dev/null
@@ -0,0 +1,72 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the libintl for msvc.
+ * No warranty is given. You can use this at your own risk.
+ */
+
+#include <windows.h>
+#include "config.h"
+#include "../intl/gettextP.h"
+
+#if defined(_MSC_VER) && defined(_DEBUG)
+#include <debug.h>
+#endif
+
+static wchar_t *libintl_current_wdomainname = NULL;
+
+extern char *wcs_to_mbs_with_malloc(UINT acp, const wchar_t *wbuffer);
+extern wchar_t *mbs_to_wcs_with_malloc(UINT acp, const char *buffer);
+
+/**
+   This function is wchar_t version of textdomain().
+   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".  */
+wchar_t *
+libintl_wtextdomain (const wchar_t *wdomainname)
+{
+  char *domainname = NULL;
+  char *new_domainname = NULL;
+  wchar_t *new_wdomainname = NULL;
+
+  domainname = wcs_to_mbs_with_malloc (CP_UTF8, wdomainname);
+  if (!domainname)
+    {
+      return NULL;
+    }
+
+  new_domainname = libintl_textdomain (domainname);
+  if (!new_domainname)
+    {
+      free (domainname);
+      return NULL;
+    }
+  if (new_domainname == domainname)
+    {
+      free (domainname);
+      return (wchar_t *) wdomainname;
+    }
+
+  new_wdomainname = mbs_to_wcs_with_malloc (CP_UTF8, domainname);
+  if (!new_wdomainname)
+    {
+      free (domainname);
+      return NULL;
+    }
+  free (libintl_current_wdomainname);
+
+  libintl_current_wdomainname = new_wdomainname;
+
+  free (domainname);
+  return (wchar_t *) libintl_current_wdomainname;
+}
+
+/**
+   free resource at program's end.
+ */
+void
+libintl_wtextdomain_freeres ()
+{
+  free (libintl_current_wdomainname);
+}
+
diff --git a/libintl/msvc/wcstombs-malloc.c b/libintl/msvc/wcstombs-malloc.c
new file mode 100644 (file)
index 0000000..4f50326
--- /dev/null
@@ -0,0 +1,104 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the libintl for msvc.
+ * No warranty is given. You can use this at your own risk.
+ */
+
+#include <windows.h>
+#include <errno.h>
+#include "config.h"
+
+#if defined(_MSC_VER) && defined(_DEBUG)
+#include <debug.h>
+#endif
+
+/* http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx */
+#define WCHAR_LIBINTL_MAX_PATH 30000
+
+
+/**
+  convert to char from wchar_t
+  Don't forget free() after use this.
+*/
+inline char *wcs_to_mbs_with_malloc(UINT acp, const wchar_t *wbuffer)
+{
+  unsigned int num = 0;
+  char *buffer = NULL;
+
+  if (wcslen (wbuffer) >= WCHAR_LIBINTL_MAX_PATH)
+    {
+      errno = ENAMETOOLONG;
+      return NULL;
+    }
+
+  num = WideCharToMultiByte (acp, 0, wbuffer, -1, NULL, 0, NULL, NULL);
+  if (num == 0)
+    {
+      errno = EACCES;
+      return NULL;
+    }
+
+  if (num >= WCHAR_LIBINTL_MAX_PATH)
+    {
+      errno = ENAMETOOLONG;
+      return NULL;
+    }
+
+  buffer = (char *)malloc (num * sizeof(char));
+  if (!buffer)
+    {
+      errno = ENOMEM;
+      return NULL;
+    }
+
+  if (0 == WideCharToMultiByte (acp, 0, wbuffer, -1, buffer, num, NULL, NULL))
+    {
+      free (buffer);
+      errno = EACCES;
+      return NULL;
+    }
+
+  errno = 0;
+  return buffer;
+}
+
+/**
+  convert to wchar_t from char
+  Don't forget free() after use this.
+*/
+inline wchar_t *mbs_to_wcs_with_malloc(UINT acp, const char *buffer)
+{
+  unsigned int num = 0;
+  wchar_t *wbuffer = NULL;
+
+  num = MultiByteToWideChar (acp, 0, buffer, -1, NULL, 0);
+  if (num == 0)
+    {
+      errno = EACCES;
+      return NULL;
+    }
+
+  if (num >= WCHAR_LIBINTL_MAX_PATH)
+    {
+      errno = ENAMETOOLONG;
+      return NULL;
+    }
+
+  wbuffer = (wchar_t *)malloc (num * sizeof(wchar_t));
+  if (!buffer)
+    {
+      errno = ENOMEM;
+      return NULL;
+    }
+
+  if (0 == MultiByteToWideChar (acp, 0, buffer, -1, wbuffer, num))
+    {
+      free (wbuffer);
+      errno = EACCES;
+      return NULL;
+    }
+
+  errno = 0;
+  return wbuffer;
+}
+
diff --git a/libintl/msvc/win_iconv.c b/libintl/msvc/win_iconv.c
new file mode 100644 (file)
index 0000000..091e292
--- /dev/null
@@ -0,0 +1,2057 @@
+/**
+  win_iconv is a iconv implementation using Win32 API to convert.
+
+  win_iconv is placed in the public domain.
+
+  ENVIRONMENT VARIABLE:
+    WINICONV_LIBICONV_DLL
+        If $WINICONV_LIBICONV_DLL is set, win_iconv uses the DLL.  If
+        loading the DLL or iconv_open() failed, falls back to internal
+        conversion.  If a few DLL are specified as comma separated list,
+        the first loadable DLL is used.  The DLL should have
+        iconv_open(), iconv_close() and iconv().  Or libiconv_open(),
+        libiconv_close() and libiconv().
+        (only available when USE_LIBICONV_DLL is defined at compile time)
+
+  Win32 API does not support strict encoding conversion for some codepage.
+  And MLang function drop or replace invalid bytes and does not return
+  useful error status as iconv.  This implementation cannot be used for
+  encoding validation purpose.
+
+  http://code.google.com/p/win-iconv/
+*/
+
+/* for WC_NO_BEST_FIT_CHARS */
+#ifndef WINVER
+# define WINVER 0x0500
+#endif
+
+#define STRICT
+#include <windows.h>
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+
+/* WORKAROUND: */
+#ifndef UNDER_CE
+#define GetProcAddressA GetProcAddress
+#endif
+
+#if 0
+# define MAKE_EXE
+# define MAKE_DLL
+# define USE_LIBICONV_DLL
+#endif
+
+#if !defined(DEFAULT_LIBICONV_DLL)
+# define DEFAULT_LIBICONV_DLL ""
+#endif
+
+#define MB_CHAR_MAX 16
+
+#define UNICODE_MODE_BOM_DONE   1
+#define UNICODE_MODE_SWAPPED    2
+
+#define FLAG_USE_BOM            1
+#define FLAG_TRANSLIT           2 /* //TRANSLIT */
+#define FLAG_IGNORE             4 /* //IGNORE */
+
+typedef unsigned char uchar;
+typedef unsigned short ushort;
+typedef unsigned int uint;
+
+typedef void* iconv_t;
+
+iconv_t iconv_open(const char *tocode, const char *fromcode);
+int iconv_close(iconv_t cd);
+size_t iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
+
+#if defined(_MSC_VER) && defined(_DEBUG)
+#define _CRTDBG_MAP_ALLOC
+#include <crtdbg.h>
+#endif
+
+/* libiconv interface for vim */
+#if defined(MAKE_DLL)
+int
+iconvctl (iconv_t cd, int request, void* argument)
+{
+    /* not supported */
+    return 0;
+}
+#endif
+
+typedef struct compat_t compat_t;
+typedef struct csconv_t csconv_t;
+typedef struct rec_iconv_t rec_iconv_t;
+
+typedef iconv_t (*f_iconv_open)(const char *tocode, const char *fromcode);
+typedef int (*f_iconv_close)(iconv_t cd);
+typedef size_t (*f_iconv)(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
+typedef int* (*f_errno)(void);
+typedef int (*f_mbtowc)(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
+typedef int (*f_wctomb)(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
+typedef int (*f_mblen)(csconv_t *cv, const uchar *buf, int bufsize);
+typedef int (*f_flush)(csconv_t *cv, uchar *buf, int bufsize);
+
+#define COMPAT_IN   1
+#define COMPAT_OUT  2
+
+/* unicode mapping for compatibility with other conversion table. */
+struct compat_t {
+    uint in;
+    uint out;
+    uint flag;
+};
+
+struct csconv_t {
+    int codepage;
+    int flags;
+    f_mbtowc mbtowc;
+    f_wctomb wctomb;
+    f_mblen mblen;
+    f_flush flush;
+    DWORD mode;
+    compat_t *compat;
+};
+
+struct rec_iconv_t {
+    iconv_t cd;
+    f_iconv_close iconv_close;
+    f_iconv iconv;
+    f_errno _errno;
+    csconv_t from;
+    csconv_t to;
+#if defined(USE_LIBICONV_DLL)
+    HMODULE hlibiconv;
+#endif
+};
+
+static int win_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode);
+static int win_iconv_close(iconv_t cd);
+static size_t win_iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
+
+static int load_mlang();
+static int make_csconv(const char *name, csconv_t *cv);
+static int name_to_codepage(const char *name);
+static uint utf16_to_ucs4(const ushort *wbuf);
+static void ucs4_to_utf16(uint wc, ushort *wbuf, int *wbufsize);
+static int mbtowc_flags(int codepage);
+static int must_use_null_useddefaultchar(int codepage);
+static char *strrstr(const char *str, const char *token);
+static char *xstrndup(const char *s, size_t n);
+static int seterror(int err);
+
+#if defined(USE_LIBICONV_DLL)
+static int libiconv_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode);
+static PVOID MyImageDirectoryEntryToData(LPVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size);
+static HMODULE find_imported_module_by_funcname(HMODULE hModule, const char *funcname);
+
+static HMODULE hwiniconv;
+#endif
+
+static int sbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize);
+static int dbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize);
+static int mbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize);
+static int utf8_mblen(csconv_t *cv, const uchar *buf, int bufsize);
+static int eucjp_mblen(csconv_t *cv, const uchar *buf, int bufsize);
+
+static int kernel_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
+static int kernel_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
+static int mlang_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
+static int mlang_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
+static int utf16_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
+static int utf16_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
+static int utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
+static int utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
+static int iso2022jp_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
+static int iso2022jp_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
+static int iso2022jp_flush(csconv_t *cv, uchar *buf, int bufsize);
+
+static struct {
+    int codepage;
+    const char *name;
+} codepage_alias[] = {
+    {65001, "CP65001"},
+    {65001, "UTF8"},
+    {65001, "UTF-8"},
+
+    {1200, "CP1200"},
+    {1200, "UTF16LE"},
+    {1200, "UTF-16LE"},
+    {1200, "UCS2LE"},
+    {1200, "UCS-2LE"},
+
+    {1201, "CP1201"},
+    {1201, "UTF16BE"},
+    {1201, "UTF-16BE"},
+    {1201, "UCS2BE"},
+    {1201, "UCS-2BE"},
+    {1201, "unicodeFFFE"},
+
+    {12000, "CP12000"},
+    {12000, "UTF32LE"},
+    {12000, "UTF-32LE"},
+    {12000, "UCS4LE"},
+    {12000, "UCS-4LE"},
+
+    {12001, "CP12001"},
+    {12001, "UTF32BE"},
+    {12001, "UTF-32BE"},
+    {12001, "UCS4BE"},
+    {12001, "UCS-4BE"},
+
+#ifndef GLIB_COMPILATION
+    /*
+     * Default is big endian.
+     * See rfc2781 4.3 Interpreting text labelled as UTF-16.
+     */
+    {1201, "UTF16"},
+    {1201, "UTF-16"},
+    {1201, "UCS2"},
+    {1201, "UCS-2"},
+    {12001, "UTF32"},
+    {12001, "UTF-32"},
+    {12001, "UCS-4"},
+    {12001, "UCS4"},
+#else
+    /* Default is little endian, because the platform is */
+    {1200, "UTF16"},
+    {1200, "UTF-16"},
+    {1200, "UCS2"},
+    {1200, "UCS-2"},
+    {12000, "UTF32"},
+    {12000, "UTF-32"},
+    {12000, "UCS4"},
+    {12000, "UCS-4"},
+#endif
+
+    /* copy from libiconv `iconv -l` */
+    /* !IsValidCodePage(367) */
+    {20127, "ANSI_X3.4-1968"},
+    {20127, "ANSI_X3.4-1986"},
+    {20127, "ASCII"},
+    {20127, "CP367"},
+    {20127, "IBM367"},
+    {20127, "ISO-IR-6"},
+    {20127, "ISO646-US"},
+    {20127, "ISO_646.IRV:1991"},
+    {20127, "US"},
+    {20127, "US-ASCII"},
+    {20127, "CSASCII"},
+
+    /* !IsValidCodePage(819) */
+    {1252, "CP819"},
+    {1252, "IBM819"},
+    {28591, "ISO-8859-1"},
+    {28591, "ISO-IR-100"},
+    {28591, "ISO8859-1"},
+    {28591, "ISO_8859-1"},
+    {28591, "ISO_8859-1:1987"},
+    {28591, "L1"},
+    {28591, "LATIN1"},
+    {28591, "CSISOLATIN1"},
+
+    {1250, "CP1250"},
+    {1250, "MS-EE"},
+    {1250, "WINDOWS-1250"},
+
+    {1251, "CP1251"},
+    {1251, "MS-CYRL"},
+    {1251, "WINDOWS-1251"},
+
+    {1252, "CP1252"},
+    {1252, "MS-ANSI"},
+    {1252, "WINDOWS-1252"},
+
+    {1253, "CP1253"},
+    {1253, "MS-GREEK"},
+    {1253, "WINDOWS-1253"},
+
+    {1254, "CP1254"},
+    {1254, "MS-TURK"},
+    {1254, "WINDOWS-1254"},
+
+    {1255, "CP1255"},
+    {1255, "MS-HEBR"},
+    {1255, "WINDOWS-1255"},
+
+    {1256, "CP1256"},
+    {1256, "MS-ARAB"},
+    {1256, "WINDOWS-1256"},
+
+    {1257, "CP1257"},
+    {1257, "WINBALTRIM"},
+    {1257, "WINDOWS-1257"},
+
+    {1258, "CP1258"},
+    {1258, "WINDOWS-1258"},
+
+    {850, "850"},
+    {850, "CP850"},
+    {850, "IBM850"},
+    {850, "CSPC850MULTILINGUAL"},
+
+    /* !IsValidCodePage(862) */
+    {862, "862"},
+    {862, "CP862"},
+    {862, "IBM862"},
+    {862, "CSPC862LATINHEBREW"},
+
+    {866, "866"},
+    {866, "CP866"},
+    {866, "IBM866"},
+    {866, "CSIBM866"},
+
+    /* !IsValidCodePage(154) */
+    {154, "CP154"},
+    {154, "CYRILLIC-ASIAN"},
+    {154, "PT154"},
+    {154, "PTCP154"},
+    {154, "CSPTCP154"},
+
+    /* !IsValidCodePage(1133) */
+    {1133, "CP1133"},
+    {1133, "IBM-CP1133"},
+
+    {874, "CP874"},
+    {874, "WINDOWS-874"},
+
+    /* !IsValidCodePage(51932) */
+    {51932, "CP51932"},
+    {51932, "MS51932"},
+    {51932, "WINDOWS-51932"},
+    {51932, "EUC-JP"},
+
+    {932, "CP932"},
+    {932, "MS932"},
+    {932, "SHIFFT_JIS"},
+    {932, "SHIFFT_JIS-MS"},
+    {932, "SJIS"},
+    {932, "SJIS-MS"},
+    {932, "SJIS-OPEN"},
+    {932, "SJIS-WIN"},
+    {932, "WINDOWS-31J"},
+    {932, "WINDOWS-932"},
+    {932, "CSWINDOWS31J"},
+
+    {50221, "CP50221"},
+    {50221, "ISO-2022-JP"},
+    {50221, "ISO-2022-JP-MS"},
+    {50221, "ISO2022-JP"},
+    {50221, "ISO2022-JP-MS"},
+    {50221, "MS50221"},
+    {50221, "WINDOWS-50221"},
+
+    {936, "CP936"},
+    {936, "GBK"},
+    {936, "MS936"},
+    {936, "WINDOWS-936"},
+
+    {950, "CP950"},
+    {950, "BIG5"},
+    {950, "BIG5HKSCS"},
+    {950, "BIG5-HKSCS"},
+
+    {949, "CP949"},
+    {949, "UHC"},
+    {949, "EUC-KR"},
+
+    {1361, "CP1361"},
+    {1361, "JOHAB"},
+
+    {437, "437"},
+    {437, "CP437"},
+    {437, "IBM437"},
+    {437, "CSPC8CODEPAGE437"},
+
+    {737, "CP737"},
+
+    {775, "CP775"},
+    {775, "IBM775"},
+    {775, "CSPC775BALTIC"},
+
+    {852, "852"},
+    {852, "CP852"},
+    {852, "IBM852"},
+    {852, "CSPCP852"},
+
+    /* !IsValidCodePage(853) */
+    {853, "CP853"},
+
+    {855, "855"},
+    {855, "CP855"},
+    {855, "IBM855"},
+    {855, "CSIBM855"},
+
+    {857, "857"},
+    {857, "CP857"},
+    {857, "IBM857"},
+    {857, "CSIBM857"},
+
+    /* !IsValidCodePage(858) */
+    {858, "CP858"},
+
+    {860, "860"},
+    {860, "CP860"},
+    {860, "IBM860"},
+    {860, "CSIBM860"},
+
+    {861, "861"},
+    {861, "CP-IS"},
+    {861, "CP861"},
+    {861, "IBM861"},
+    {861, "CSIBM861"},
+
+    {863, "863"},
+    {863, "CP863"},
+    {863, "IBM863"},
+    {863, "CSIBM863"},
+
+    {864, "CP864"},
+    {864, "IBM864"},
+    {864, "CSIBM864"},
+
+    {865, "865"},
+    {865, "CP865"},
+    {865, "IBM865"},
+    {865, "CSIBM865"},
+
+    {869, "869"},
+    {869, "CP-GR"},
+    {869, "CP869"},
+    {869, "IBM869"},
+    {869, "CSIBM869"},
+
+    /* !IsValidCodePage(1152) */
+    {1125, "CP1125"},
+
+    /*
+     * Code Page Identifiers
+     * http://msdn2.microsoft.com/en-us/library/ms776446.aspx
+     */
+    {37, "IBM037"}, /* IBM EBCDIC US-Canada */
+    {437, "IBM437"}, /* OEM United States */
+    {500, "IBM500"}, /* IBM EBCDIC International */
+    {708, "ASMO-708"}, /* Arabic (ASMO 708) */
+    /* 709             Arabic (ASMO-449+, BCON V4) */
+    /* 710             Arabic - Transparent Arabic */
+    {720, "DOS-720"}, /* Arabic (Transparent ASMO); Arabic (DOS) */
+    {737, "ibm737"}, /* OEM Greek (formerly 437G); Greek (DOS) */
+    {775, "ibm775"}, /* OEM Baltic; Baltic (DOS) */
+    {850, "ibm850"}, /* OEM Multilingual Latin 1; Western European (DOS) */
+    {852, "ibm852"}, /* OEM Latin 2; Central European (DOS) */
+    {855, "IBM855"}, /* OEM Cyrillic (primarily Russian) */
+    {857, "ibm857"}, /* OEM Turkish; Turkish (DOS) */
+    {858, "IBM00858"}, /* OEM Multilingual Latin 1 + Euro symbol */
+    {860, "IBM860"}, /* OEM Portuguese; Portuguese (DOS) */
+    {861, "ibm861"}, /* OEM Icelandic; Icelandic (DOS) */
+    {862, "DOS-862"}, /* OEM Hebrew; Hebrew (DOS) */
+    {863, "IBM863"}, /* OEM French Canadian; French Canadian (DOS) */
+    {864, "IBM864"}, /* OEM Arabic; Arabic (864) */
+    {865, "IBM865"}, /* OEM Nordic; Nordic (DOS) */
+    {866, "cp866"}, /* OEM Russian; Cyrillic (DOS) */
+    {869, "ibm869"}, /* OEM Modern Greek; Greek, Modern (DOS) */
+    {870, "IBM870"}, /* IBM EBCDIC Multilingual/ROECE (Latin 2); IBM EBCDIC Multilingual Latin 2 */
+    {874, "windows-874"}, /* ANSI/OEM Thai (same as 28605, ISO 8859-15); Thai (Windows) */
+    {875, "cp875"}, /* IBM EBCDIC Greek Modern */
+    {932, "shift_jis"}, /* ANSI/OEM Japanese; Japanese (Shift-JIS) */
+    {932, "shift-jis"}, /* alternative name for it */
+    {936, "gb2312"}, /* ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312) */
+    {949, "ks_c_5601-1987"}, /* ANSI/OEM Korean (Unified Hangul Code) */
+    {950, "big5"}, /* ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5) */
+    {950, "big5hkscs"}, /* ANSI/OEM Traditional Chinese (Hong Kong SAR); Chinese Traditional (Big5-HKSCS) */
+    {950, "big5-hkscs"}, /* alternative name for it */
+    {1026, "IBM1026"}, /* IBM EBCDIC Turkish (Latin 5) */
+    {1047, "IBM01047"}, /* IBM EBCDIC Latin 1/Open System */
+    {1140, "IBM01140"}, /* IBM EBCDIC US-Canada (037 + Euro symbol); IBM EBCDIC (US-Canada-Euro) */
+    {1141, "IBM01141"}, /* IBM EBCDIC Germany (20273 + Euro symbol); IBM EBCDIC (Germany-Euro) */
+    {1142, "IBM01142"}, /* IBM EBCDIC Denmark-Norway (20277 + Euro symbol); IBM EBCDIC (Denmark-Norway-Euro) */
+    {1143, "IBM01143"}, /* IBM EBCDIC Finland-Sweden (20278 + Euro symbol); IBM EBCDIC (Finland-Sweden-Euro) */
+    {1144, "IBM01144"}, /* IBM EBCDIC Italy (20280 + Euro symbol); IBM EBCDIC (Italy-Euro) */
+    {1145, "IBM01145"}, /* IBM EBCDIC Latin America-Spain (20284 + Euro symbol); IBM EBCDIC (Spain-Euro) */
+    {1146, "IBM01146"}, /* IBM EBCDIC United Kingdom (20285 + Euro symbol); IBM EBCDIC (UK-Euro) */
+    {1147, "IBM01147"}, /* IBM EBCDIC France (20297 + Euro symbol); IBM EBCDIC (France-Euro) */
+    {1148, "IBM01148"}, /* IBM EBCDIC International (500 + Euro symbol); IBM EBCDIC (International-Euro) */
+    {1149, "IBM01149"}, /* IBM EBCDIC Icelandic (20871 + Euro symbol); IBM EBCDIC (Icelandic-Euro) */
+    {1250, "windows-1250"}, /* ANSI Central European; Central European (Windows) */
+    {1251, "windows-1251"}, /* ANSI Cyrillic; Cyrillic (Windows) */
+    {1252, "windows-1252"}, /* ANSI Latin 1; Western European (Windows) */
+    {1253, "windows-1253"}, /* ANSI Greek; Greek (Windows) */
+    {1254, "windows-1254"}, /* ANSI Turkish; Turkish (Windows) */
+    {1255, "windows-1255"}, /* ANSI Hebrew; Hebrew (Windows) */
+    {1256, "windows-1256"}, /* ANSI Arabic; Arabic (Windows) */
+    {1257, "windows-1257"}, /* ANSI Baltic; Baltic (Windows) */
+    {1258, "windows-1258"}, /* ANSI/OEM Vietnamese; Vietnamese (Windows) */
+    {1361, "Johab"}, /* Korean (Johab) */
+    {10000, "macintosh"}, /* MAC Roman; Western European (Mac) */
+    {10001, "x-mac-japanese"}, /* Japanese (Mac) */
+    {10002, "x-mac-chinesetrad"}, /* MAC Traditional Chinese (Big5); Chinese Traditional (Mac) */
+    {10003, "x-mac-korean"}, /* Korean (Mac) */
+    {10004, "x-mac-arabic"}, /* Arabic (Mac) */
+    {10005, "x-mac-hebrew"}, /* Hebrew (Mac) */
+    {10006, "x-mac-greek"}, /* Greek (Mac) */
+    {10007, "x-mac-cyrillic"}, /* Cyrillic (Mac) */
+    {10008, "x-mac-chinesesimp"}, /* MAC Simplified Chinese (GB 2312); Chinese Simplified (Mac) */
+    {10010, "x-mac-romanian"}, /* Romanian (Mac) */
+    {10017, "x-mac-ukrainian"}, /* Ukrainian (Mac) */
+    {10021, "x-mac-thai"}, /* Thai (Mac) */
+    {10029, "x-mac-ce"}, /* MAC Latin 2; Central European (Mac) */
+    {10079, "x-mac-icelandic"}, /* Icelandic (Mac) */
+    {10081, "x-mac-turkish"}, /* Turkish (Mac) */
+    {10082, "x-mac-croatian"}, /* Croatian (Mac) */
+    {20000, "x-Chinese_CNS"}, /* CNS Taiwan; Chinese Traditional (CNS) */
+    {20001, "x-cp20001"}, /* TCA Taiwan */
+    {20002, "x_Chinese-Eten"}, /* Eten Taiwan; Chinese Traditional (Eten) */
+    {20003, "x-cp20003"}, /* IBM5550 Taiwan */
+    {20004, "x-cp20004"}, /* TeleText Taiwan */
+    {20005, "x-cp20005"}, /* Wang Taiwan */
+    {20105, "x-IA5"}, /* IA5 (IRV International Alphabet No. 5, 7-bit); Western European (IA5) */
+    {20106, "x-IA5-German"}, /* IA5 German (7-bit) */
+    {20107, "x-IA5-Swedish"}, /* IA5 Swedish (7-bit) */
+    {20108, "x-IA5-Norwegian"}, /* IA5 Norwegian (7-bit) */
+    {20127, "us-ascii"}, /* US-ASCII (7-bit) */
+    {20261, "x-cp20261"}, /* T.61 */
+    {20269, "x-cp20269"}, /* ISO 6937 Non-Spacing Accent */
+    {20273, "IBM273"}, /* IBM EBCDIC Germany */
+    {20277, "IBM277"}, /* IBM EBCDIC Denmark-Norway */
+    {20278, "IBM278"}, /* IBM EBCDIC Finland-Sweden */
+    {20280, "IBM280"}, /* IBM EBCDIC Italy */
+    {20284, "IBM284"}, /* IBM EBCDIC Latin America-Spain */
+    {20285, "IBM285"}, /* IBM EBCDIC United Kingdom */
+    {20290, "IBM290"}, /* IBM EBCDIC Japanese Katakana Extended */
+    {20297, "IBM297"}, /* IBM EBCDIC France */
+    {20420, "IBM420"}, /* IBM EBCDIC Arabic */
+    {20423, "IBM423"}, /* IBM EBCDIC Greek */
+    {20424, "IBM424"}, /* IBM EBCDIC Hebrew */
+    {20833, "x-EBCDIC-KoreanExtended"}, /* IBM EBCDIC Korean Extended */
+    {20838, "IBM-Thai"}, /* IBM EBCDIC Thai */
+    {20866, "koi8-r"}, /* Russian (KOI8-R); Cyrillic (KOI8-R) */
+    {20871, "IBM871"}, /* IBM EBCDIC Icelandic */
+    {20880, "IBM880"}, /* IBM EBCDIC Cyrillic Russian */
+    {20905, "IBM905"}, /* IBM EBCDIC Turkish */
+    {20924, "IBM00924"}, /* IBM EBCDIC Latin 1/Open System (1047 + Euro symbol) */
+    {20932, "EUC-JP"}, /* Japanese (JIS 0208-1990 and 0121-1990) */
+    {20936, "x-cp20936"}, /* Simplified Chinese (GB2312); Chinese Simplified (GB2312-80) */
+    {20949, "x-cp20949"}, /* Korean Wansung */
+    {21025, "cp1025"}, /* IBM EBCDIC Cyrillic Serbian-Bulgarian */
+    /* 21027           (deprecated) */
+    {21866, "koi8-u"}, /* Ukrainian (KOI8-U); Cyrillic (KOI8-U) */
+    {28591, "iso-8859-1"}, /* ISO 8859-1 Latin 1; Western European (ISO) */
+    {28591, "iso8859-1"}, /* ISO 8859-1 Latin 1; Western European (ISO) */
+    {28592, "iso-8859-2"}, /* ISO 8859-2 Central European; Central European (ISO) */
+    {28592, "iso8859-2"}, /* ISO 8859-2 Central European; Central European (ISO) */
+    {28593, "iso-8859-3"}, /* ISO 8859-3 Latin 3 */
+    {28593, "iso8859-3"}, /* ISO 8859-3 Latin 3 */
+    {28594, "iso-8859-4"}, /* ISO 8859-4 Baltic */
+    {28594, "iso8859-4"}, /* ISO 8859-4 Baltic */
+    {28595, "iso-8859-5"}, /* ISO 8859-5 Cyrillic */
+    {28595, "iso8859-5"}, /* ISO 8859-5 Cyrillic */
+    {28596, "iso-8859-6"}, /* ISO 8859-6 Arabic */
+    {28596, "iso8859-6"}, /* ISO 8859-6 Arabic */
+    {28597, "iso-8859-7"}, /* ISO 8859-7 Greek */
+    {28597, "iso8859-7"}, /* ISO 8859-7 Greek */
+    {28598, "iso-8859-8"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Visual) */
+    {28598, "iso8859-8"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Visual) */
+    {28599, "iso-8859-9"}, /* ISO 8859-9 Turkish */
+    {28599, "iso8859-9"}, /* ISO 8859-9 Turkish */
+    {28603, "iso-8859-13"}, /* ISO 8859-13 Estonian */
+    {28603, "iso8859-13"}, /* ISO 8859-13 Estonian */
+    {28605, "iso-8859-15"}, /* ISO 8859-15 Latin 9 */
+    {28605, "iso8859-15"}, /* ISO 8859-15 Latin 9 */
+    {29001, "x-Europa"}, /* Europa 3 */
+    {38598, "iso-8859-8-i"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Logical) */
+    {38598, "iso8859-8-i"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Logical) */
+    {50220, "iso-2022-jp"}, /* ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS) */
+    {50221, "csISO2022JP"}, /* ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana) */
+    {50222, "iso-2022-jp"}, /* ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI) */
+    {50225, "iso-2022-kr"}, /* ISO 2022 Korean */
+    {50225, "iso2022-kr"}, /* ISO 2022 Korean */
+    {50227, "x-cp50227"}, /* ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022) */
+    /* 50229           ISO 2022 Traditional Chinese */
+    /* 50930           EBCDIC Japanese (Katakana) Extended */
+    /* 50931           EBCDIC US-Canada and Japanese */
+    /* 50933           EBCDIC Korean Extended and Korean */
+    /* 50935           EBCDIC Simplified Chinese Extended and Simplified Chinese */
+    /* 50936           EBCDIC Simplified Chinese */
+    /* 50937           EBCDIC US-Canada and Traditional Chinese */
+    /* 50939           EBCDIC Japanese (Latin) Extended and Japanese */
+    {51932, "euc-jp"}, /* EUC Japanese */
+    {51936, "EUC-CN"}, /* EUC Simplified Chinese; Chinese Simplified (EUC) */
+    {51949, "euc-kr"}, /* EUC Korean */
+    /* 51950           EUC Traditional Chinese */
+    {52936, "hz-gb-2312"}, /* HZ-GB2312 Simplified Chinese; Chinese Simplified (HZ) */
+    {54936, "GB18030"}, /* Windows XP and later: GB18030 Simplified Chinese (4 byte); Chinese Simplified (GB18030) */
+    {57002, "x-iscii-de"}, /* ISCII Devanagari */
+    {57003, "x-iscii-be"}, /* ISCII Bengali */
+    {57004, "x-iscii-ta"}, /* ISCII Tamil */
+    {57005, "x-iscii-te"}, /* ISCII Telugu */
+    {57006, "x-iscii-as"}, /* ISCII Assamese */
+    {57007, "x-iscii-or"}, /* ISCII Oriya */
+    {57008, "x-iscii-ka"}, /* ISCII Kannada */
+    {57009, "x-iscii-ma"}, /* ISCII Malayalam */
+    {57010, "x-iscii-gu"}, /* ISCII Gujarati */
+    {57011, "x-iscii-pa"}, /* ISCII Punjabi */
+
+    {0, NULL}
+};
+
+/*
+ * SJIS SHIFTJIS table              CP932 table
+ * ---- --------------------------- --------------------------------
+ *   5C U+00A5 YEN SIGN             U+005C REVERSE SOLIDUS
+ *   7E U+203E OVERLINE             U+007E TILDE
+ * 815C U+2014 EM DASH              U+2015 HORIZONTAL BAR
+ * 815F U+005C REVERSE SOLIDUS      U+FF3C FULLWIDTH REVERSE SOLIDUS
+ * 8160 U+301C WAVE DASH            U+FF5E FULLWIDTH TILDE
+ * 8161 U+2016 DOUBLE VERTICAL LINE U+2225 PARALLEL TO
+ * 817C U+2212 MINUS SIGN           U+FF0D FULLWIDTH HYPHEN-MINUS
+ * 8191 U+00A2 CENT SIGN            U+FFE0 FULLWIDTH CENT SIGN
+ * 8192 U+00A3 POUND SIGN           U+FFE1 FULLWIDTH POUND SIGN
+ * 81CA U+00AC NOT SIGN             U+FFE2 FULLWIDTH NOT SIGN
+ *
+ * EUC-JP and ISO-2022-JP should be compatible with CP932.
+ *
+ * Kernel and MLang have different Unicode mapping table.  Make sure
+ * which API is used.
+ */
+static compat_t cp932_compat[] = {
+    {0x00A5, 0x005C, COMPAT_OUT},
+    {0x203E, 0x007E, COMPAT_OUT},
+    {0x2014, 0x2015, COMPAT_OUT},
+    {0x301C, 0xFF5E, COMPAT_OUT},
+    {0x2016, 0x2225, COMPAT_OUT},
+    {0x2212, 0xFF0D, COMPAT_OUT},
+    {0x00A2, 0xFFE0, COMPAT_OUT},
+    {0x00A3, 0xFFE1, COMPAT_OUT},
+    {0x00AC, 0xFFE2, COMPAT_OUT},
+    {0, 0, 0}
+};
+
+static compat_t cp20932_compat[] = {
+    {0x00A5, 0x005C, COMPAT_OUT},
+    {0x203E, 0x007E, COMPAT_OUT},
+    {0x2014, 0x2015, COMPAT_OUT},
+    {0xFF5E, 0x301C, COMPAT_OUT|COMPAT_IN},
+    {0x2225, 0x2016, COMPAT_OUT|COMPAT_IN},
+    {0xFF0D, 0x2212, COMPAT_OUT|COMPAT_IN},
+    {0xFFE0, 0x00A2, COMPAT_OUT|COMPAT_IN},
+    {0xFFE1, 0x00A3, COMPAT_OUT|COMPAT_IN},
+    {0xFFE2, 0x00AC, COMPAT_OUT|COMPAT_IN},
+    {0, 0, 0}
+};
+
+static compat_t *cp51932_compat = cp932_compat;
+
+/* cp20932_compat for kernel.  cp932_compat for mlang. */
+static compat_t *cp5022x_compat = cp932_compat;
+
+typedef HRESULT (WINAPI *CONVERTINETSTRING)(
+    LPDWORD lpdwMode,
+    DWORD dwSrcEncoding,
+    DWORD dwDstEncoding,
+    LPCSTR lpSrcStr,
+    LPINT lpnSrcSize,
+    LPBYTE lpDstStr,
+    LPINT lpnDstSize
+);
+typedef HRESULT (WINAPI *CONVERTINETMULTIBYTETOUNICODE)(
+    LPDWORD lpdwMode,
+    DWORD dwSrcEncoding,
+    LPCSTR lpSrcStr,
+    LPINT lpnMultiCharCount,
+    LPWSTR lpDstStr,
+    LPINT lpnWideCharCount
+);
+typedef HRESULT (WINAPI *CONVERTINETUNICODETOMULTIBYTE)(
+    LPDWORD lpdwMode,
+    DWORD dwEncoding,
+    LPCWSTR lpSrcStr,
+    LPINT lpnWideCharCount,
+    LPSTR lpDstStr,
+    LPINT lpnMultiCharCount
+);
+typedef HRESULT (WINAPI *ISCONVERTINETSTRINGAVAILABLE)(
+    DWORD dwSrcEncoding,
+    DWORD dwDstEncoding
+);
+typedef HRESULT (WINAPI *LCIDTORFC1766A)(
+    LCID Locale,
+    LPSTR pszRfc1766,
+    int nChar
+);
+typedef HRESULT (WINAPI *LCIDTORFC1766W)(
+    LCID Locale,
+    LPWSTR pszRfc1766,
+    int nChar
+);
+typedef HRESULT (WINAPI *RFC1766TOLCIDA)(
+    LCID *pLocale,
+    LPSTR pszRfc1766
+);
+typedef HRESULT (WINAPI *RFC1766TOLCIDW)(
+    LCID *pLocale,
+    LPWSTR pszRfc1766
+);
+static CONVERTINETSTRING ConvertINetString;
+static CONVERTINETMULTIBYTETOUNICODE ConvertINetMultiByteToUnicode;
+static CONVERTINETUNICODETOMULTIBYTE ConvertINetUnicodeToMultiByte;
+static ISCONVERTINETSTRINGAVAILABLE IsConvertINetStringAvailable;
+static LCIDTORFC1766A LcidToRfc1766A;
+static RFC1766TOLCIDA Rfc1766ToLcidA;
+
+static int
+load_mlang()
+{
+    HMODULE h;
+    if (ConvertINetString != NULL)
+        return TRUE;
+    h = LoadLibrary(TEXT("mlang.dll"));
+    if (!h)
+        return FALSE;
+    ConvertINetString = (CONVERTINETSTRING)GetProcAddressA(h, "ConvertINetString");
+    ConvertINetMultiByteToUnicode = (CONVERTINETMULTIBYTETOUNICODE)GetProcAddressA(h, "ConvertINetMultiByteToUnicode");
+    ConvertINetUnicodeToMultiByte = (CONVERTINETUNICODETOMULTIBYTE)GetProcAddressA(h, "ConvertINetUnicodeToMultiByte");
+    IsConvertINetStringAvailable = (ISCONVERTINETSTRINGAVAILABLE)GetProcAddressA(h, "IsConvertINetStringAvailable");
+    LcidToRfc1766A = (LCIDTORFC1766A)GetProcAddressA(h, "LcidToRfc1766A");
+    Rfc1766ToLcidA = (RFC1766TOLCIDA)GetProcAddressA(h, "Rfc1766ToLcidA");
+    return TRUE;
+}
+
+iconv_t
+iconv_open(const char *tocode, const char *fromcode)
+{
+    rec_iconv_t *cd;
+
+    cd = (rec_iconv_t *)calloc(1, sizeof(rec_iconv_t));
+    if (cd == NULL)
+        return (iconv_t)(-1);
+
+#if defined(USE_LIBICONV_DLL)
+    errno = 0;
+    if (libiconv_iconv_open(cd, tocode, fromcode))
+        return (iconv_t)cd;
+#endif
+
+    /* reset the errno to prevent reporting wrong error code.
+     * 0 for unsorted error. */
+    errno = 0;
+    if (win_iconv_open(cd, tocode, fromcode))
+        return (iconv_t)cd;
+
+    free(cd);
+
+    return (iconv_t)(-1);
+}
+
+int
+iconv_close(iconv_t _cd)
+{
+    rec_iconv_t *cd = (rec_iconv_t *)_cd;
+    int r = cd->iconv_close(cd->cd);
+    int e = *(cd->_errno());
+#if defined(USE_LIBICONV_DLL)
+    if (cd->hlibiconv != NULL)
+        FreeLibrary(cd->hlibiconv);
+#endif
+    free(cd);
+    errno = e;
+    return r;
+}
+
+size_t
+iconv(iconv_t _cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
+{
+    rec_iconv_t *cd = (rec_iconv_t *)_cd;
+    size_t r = cd->iconv(cd->cd, inbuf, inbytesleft, outbuf, outbytesleft);
+    errno = *(cd->_errno());
+    return r;
+}
+
+static int
+win_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode)
+{
+    if (!make_csconv(fromcode, &cd->from) || !make_csconv(tocode, &cd->to))
+        return FALSE;
+    cd->iconv_close = win_iconv_close;
+    cd->iconv = win_iconv;
+    cd->_errno = _errno;
+    cd->cd = (iconv_t)cd;
+    return TRUE;
+}
+
+static int
+win_iconv_close(iconv_t cd)
+{
+    return 0;
+}
+
+static size_t
+win_iconv(iconv_t _cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
+{
+    rec_iconv_t *cd = (rec_iconv_t *)_cd;
+    ushort wbuf[MB_CHAR_MAX]; /* enough room for one character */
+    int insize;
+    int outsize;
+    int wsize;
+    DWORD frommode;
+    DWORD tomode;
+    uint wc;
+    compat_t *cp;
+    int i;
+
+    if (inbuf == NULL || *inbuf == NULL)
+    {
+        if (outbuf != NULL && *outbuf != NULL && cd->to.flush != NULL)
+        {
+            tomode = cd->to.mode;
+            outsize = cd->to.flush(&cd->to, (uchar *)*outbuf, *outbytesleft);
+            if (outsize == -1)
+            {
+                if ((cd->to.flags & FLAG_IGNORE) && errno != E2BIG)
+                {
+                    outsize = 0;
+                }
+                else
+                {
+                    cd->to.mode = tomode;
+                    return (size_t)(-1);
+                }
+            }
+            *outbuf += outsize;
+            *outbytesleft -= outsize;
+        }
+        cd->from.mode = 0;
+        cd->to.mode = 0;
+        return 0;
+    }
+
+    while (*inbytesleft != 0)
+    {
+        frommode = cd->from.mode;
+        tomode = cd->to.mode;
+        wsize = MB_CHAR_MAX;
+
+        insize = cd->from.mbtowc(&cd->from, (const uchar *)*inbuf, *inbytesleft, wbuf, &wsize);
+        if (insize == -1)
+        {
+            if (cd->to.flags & FLAG_IGNORE)
+            {
+                cd->from.mode = frommode;
+                insize = 1;
+                wsize = 0;
+            }
+            else
+            {
+                cd->from.mode = frommode;
+                return (size_t)(-1);
+            }
+        }
+
+        if (wsize == 0)
+        {
+            *inbuf += insize;
+            *inbytesleft -= insize;
+            continue;
+        }
+
+        if (cd->from.compat != NULL)
+        {
+            wc = utf16_to_ucs4(wbuf);
+            cp = cd->from.compat;
+            for (i = 0; cp[i].in != 0; ++i)
+            {
+                if ((cp[i].flag & COMPAT_IN) && cp[i].out == wc)
+                {
+                    ucs4_to_utf16(cp[i].in, wbuf, &wsize);
+                    break;
+                }
+            }
+        }
+
+        if (cd->to.compat != NULL)
+        {
+            wc = utf16_to_ucs4(wbuf);
+            cp = cd->to.compat;
+            for (i = 0; cp[i].in != 0; ++i)
+            {
+                if ((cp[i].flag & COMPAT_OUT) && cp[i].in == wc)
+                {
+                    ucs4_to_utf16(cp[i].out, wbuf, &wsize);
+                    break;
+                }
+            }
+        }
+
+        outsize = cd->to.wctomb(&cd->to, wbuf, wsize, (uchar *)*outbuf, *outbytesleft);
+        if (outsize == -1)
+        {
+            if ((cd->to.flags & FLAG_IGNORE) && errno != E2BIG)
+            {
+                cd->to.mode = tomode;
+                outsize = 0;
+            }
+            else
+            {
+                cd->from.mode = frommode;
+                cd->to.mode = tomode;
+                return (size_t)(-1);
+            }
+        }
+
+        *inbuf += insize;
+        *outbuf += outsize;
+        *inbytesleft -= insize;
+        *outbytesleft -= outsize;
+    }
+
+    return 0;
+}
+
+static int
+make_csconv(const char *_name, csconv_t *cv)
+{
+    CPINFO cpinfo;
+    int use_compat = TRUE;
+    int flag = 0;
+    char *name;
+    char *p;
+
+    name = xstrndup(_name, strlen(_name));
+    if (name == NULL)
+        return FALSE;
+
+    /* check for option "enc_name//opt1//opt2" */
+    while ((p = strrstr(name, "//")) != NULL)
+    {
+        if (_stricmp(p + 2, "nocompat") == 0)
+            use_compat = FALSE;
+        else if (_stricmp(p + 2, "translit") == 0)
+            flag |= FLAG_TRANSLIT;
+        else if (_stricmp(p + 2, "ignore") == 0)
+            flag |= FLAG_IGNORE;
+        *p = 0;
+    }
+
+    cv->mode = 0;
+    cv->flags = flag;
+    cv->mblen = NULL;
+    cv->flush = NULL;
+    cv->compat = NULL;
+    cv->codepage = name_to_codepage(name);
+    if (cv->codepage == 1200 || cv->codepage == 1201)
+    {
+        cv->mbtowc = utf16_mbtowc;
+        cv->wctomb = utf16_wctomb;
+        if (_stricmp(name, "UTF-16") == 0 || _stricmp(name, "UTF16") == 0 ||
+          _stricmp(name, "UCS-2") == 0 || _stricmp(name, "UCS2") == 0)
+            cv->flags |= FLAG_USE_BOM;
+    }
+    else if (cv->codepage == 12000 || cv->codepage == 12001)
+    {
+        cv->mbtowc = utf32_mbtowc;
+        cv->wctomb = utf32_wctomb;
+        if (_stricmp(name, "UTF-32") == 0 || _stricmp(name, "UTF32") == 0 ||
+          _stricmp(name, "UCS-4") == 0 || _stricmp(name, "UCS4") == 0)
+            cv->flags |= FLAG_USE_BOM;
+    }
+    else if (cv->codepage == 65001)
+    {
+        cv->mbtowc = kernel_mbtowc;
+        cv->wctomb = kernel_wctomb;
+        cv->mblen = utf8_mblen;
+    }
+    else if ((cv->codepage == 50220 || cv->codepage == 50221 || cv->codepage == 50222) && load_mlang())
+    {
+        cv->mbtowc = iso2022jp_mbtowc;
+        cv->wctomb = iso2022jp_wctomb;
+        cv->flush = iso2022jp_flush;
+    }
+    else if (cv->codepage == 51932 && load_mlang())
+    {
+        cv->mbtowc = mlang_mbtowc;
+        cv->wctomb = mlang_wctomb;
+        cv->mblen = eucjp_mblen;
+    }
+    else if (IsValidCodePage(cv->codepage)
+            && GetCPInfo(cv->codepage, &cpinfo) != 0)
+    {
+        cv->mbtowc = kernel_mbtowc;
+        cv->wctomb = kernel_wctomb;
+        if (cpinfo.MaxCharSize == 1)
+            cv->mblen = sbcs_mblen;
+        else if (cpinfo.MaxCharSize == 2)
+            cv->mblen = dbcs_mblen;
+       else
+           cv->mblen = mbcs_mblen;
+    }
+    else
+    {
+        /* not supported */
+        free(name);
+        errno = EINVAL;
+        return FALSE;
+    }
+
+    if (use_compat)
+    {
+        switch (cv->codepage)
+        {
+        case 932: cv->compat = cp932_compat; break;
+        case 20932: cv->compat = cp20932_compat; break;
+        case 51932: cv->compat = cp51932_compat; break;
+        case 50220: case 50221: case 50222: cv->compat = cp5022x_compat; break;
+        }
+    }
+
+    free(name);
+
+    return TRUE;
+}
+
+static int
+name_to_codepage(const char *name)
+{
+    int i;
+
+    if (*name == '\0' ||
+       strcmp(name, "char") == 0)
+        return GetACP();
+    else if (strcmp(name, "wchar_t") == 0)
+        return 1200;
+    else if (_strnicmp(name, "cp", 2) == 0)
+        return atoi(name + 2); /* CP123 */
+    else if ('0' <= name[0] && name[0] <= '9')
+        return atoi(name);     /* 123 */
+    else if (_strnicmp(name, "xx", 2) == 0)
+        return atoi(name + 2); /* XX123 for debug */
+
+    for (i = 0; codepage_alias[i].name != NULL; ++i)
+        if (_stricmp(name, codepage_alias[i].name) == 0)
+            return codepage_alias[i].codepage;
+    return -1;
+}
+
+/*
+ * http://www.faqs.org/rfcs/rfc2781.html
+ */
+static uint
+utf16_to_ucs4(const ushort *wbuf)
+{
+    uint wc = wbuf[0];
+    if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF)
+        wc = ((wbuf[0] & 0x3FF) << 10) + (wbuf[1] & 0x3FF) + 0x10000;
+    return wc;
+}
+
+static void
+ucs4_to_utf16(uint wc, ushort *wbuf, int *wbufsize)
+{
+    if (wc < 0x10000)
+    {
+        wbuf[0] = wc;
+        *wbufsize = 1;
+    }
+    else
+    {
+        wc -= 0x10000;
+        wbuf[0] = 0xD800 | ((wc >> 10) & 0x3FF);
+        wbuf[1] = 0xDC00 | (wc & 0x3FF);
+        *wbufsize = 2;
+    }
+}
+
+/*
+ * Check if codepage is one of those for which the dwFlags parameter
+ * to MultiByteToWideChar() must be zero. Return zero or
+ * MB_ERR_INVALID_CHARS.  The docs in Platform SDK for for Windows
+ * Server 2003 R2 claims that also codepage 65001 is one of these, but
+ * that doesn't seem to be the case. The MSDN docs for MSVS2008 leave
+ * out 65001 (UTF-8), and that indeed seems to be the case on XP, it
+ * works fine to pass MB_ERR_INVALID_CHARS in dwFlags when converting
+ * from UTF-8.
+ */
+static int
+mbtowc_flags(int codepage)
+{
+    return (codepage == 50220 || codepage == 50221 ||
+           codepage == 50222 || codepage == 50225 ||
+           codepage == 50227 || codepage == 50229 ||
+           codepage == 52936 || codepage == 54936 ||
+           (codepage >= 57002 && codepage <= 57011) ||
+           codepage == 65000 || codepage == 42) ? 0 : MB_ERR_INVALID_CHARS;
+}
+
+/*
+ * Check if codepage is one those for which the lpUsedDefaultChar
+ * parameter to WideCharToMultiByte() must be NULL.  The docs in
+ * Platform SDK for for Windows Server 2003 R2 claims that this is the
+ * list below, while the MSDN docs for MSVS2008 claim that it is only
+ * for 65000 (UTF-7) and 65001 (UTF-8). This time the earlier Platform
+ * SDK seems to be correct, at least for XP.
+ */
+static int
+must_use_null_useddefaultchar(int codepage)
+{
+    return (codepage == 65000 || codepage == 65001 ||
+            codepage == 50220 || codepage == 50221 ||
+            codepage == 50222 || codepage == 50225 ||
+            codepage == 50227 || codepage == 50229 ||
+            codepage == 52936 || codepage == 54936 ||
+            (codepage >= 57002 && codepage <= 57011) ||
+            codepage == 42);
+}
+
+static char *
+strrstr(const char *str, const char *token)
+{
+    int len = strlen(token);
+    const char *p = str + strlen(str);
+
+    while (str <= --p)
+        if (p[0] == token[0] && strncmp(p, token, len) == 0)
+            return (char *)p;
+    return NULL;
+}
+
+static char *
+xstrndup(const char *s, size_t n)
+{
+    char *p;
+
+    p = (char *)malloc(n + 1);
+    if (p == NULL)
+        return NULL;
+    memcpy(p, s, n);
+    p[n] = '\0';
+    return p;
+}
+
+static int
+seterror(int err)
+{
+    errno = err;
+    return -1;
+}
+
+#if defined(USE_LIBICONV_DLL)
+static int
+libiconv_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode)
+{
+    HMODULE hlibiconv = NULL;
+    HMODULE hmsvcrt = NULL;
+    char *dllname;
+    const char *p;
+    const char *e;
+    f_iconv_open _iconv_open;
+
+    /*
+     * always try to load dll, so that we can switch dll in runtime.
+     */
+
+    /* XXX: getenv() can't get variable set by SetEnvironmentVariable() */
+    p = getenv("WINICONV_LIBICONV_DLL");
+    if (p == NULL)
+        p = DEFAULT_LIBICONV_DLL;
+    /* parse comma separated value */
+    for ( ; *p != 0; p = (*e == ',') ? e + 1 : e)
+    {
+        e = strchr(p, ',');
+        if (p == e)
+            continue;
+        else if (e == NULL)
+            e = p + strlen(p);
+        dllname = xstrndup(p, e - p);
+        if (dllname == NULL)
+            return FALSE;
+        hlibiconv = LoadLibraryA(dllname);
+        free(dllname);
+        if (hlibiconv != NULL)
+        {
+            if (hlibiconv == hwiniconv)
+            {
+                FreeLibrary(hlibiconv);
+                hlibiconv = NULL;
+                continue;
+            }
+            break;
+        }
+    }
+
+    if (hlibiconv == NULL)
+        goto failed;
+
+    hmsvcrt = find_imported_module_by_funcname(hlibiconv, "_errno");
+    if (hmsvcrt == NULL)
+        goto failed;
+
+    _iconv_open = (f_iconv_open)GetProcAddressA(hlibiconv, "libiconv_open");
+    if (_iconv_open == NULL)
+        _iconv_open = (f_iconv_open)GetProcAddressA(hlibiconv, "iconv_open");
+    cd->iconv_close = (f_iconv_close)GetProcAddressA(hlibiconv, "libiconv_close");
+    if (cd->iconv_close == NULL)
+        cd->iconv_close = (f_iconv_close)GetProcAddressA(hlibiconv, "iconv_close");
+    cd->iconv = (f_iconv)GetProcAddressA(hlibiconv, "libiconv");
+    if (cd->iconv == NULL)
+        cd->iconv = (f_iconv)GetProcAddressA(hlibiconv, "iconv");
+    cd->_errno = (f_errno)GetProcAddressA(hmsvcrt, "_errno");
+    if (_iconv_open == NULL || cd->iconv_close == NULL
+            || cd->iconv == NULL || cd->_errno == NULL)
+        goto failed;
+
+    cd->cd = _iconv_open(tocode, fromcode);
+    if (cd->cd == (iconv_t)(-1))
+        goto failed;
+
+    cd->hlibiconv = hlibiconv;
+    return TRUE;
+
+failed:
+    if (hlibiconv != NULL)
+        FreeLibrary(hlibiconv);
+    /* do not free hmsvcrt which is obtained by GetModuleHandle() */
+    return FALSE;
+}
+
+/*
+ * Reference:
+ * http://forums.belution.com/ja/vc/000/234/78s.shtml
+ * http://nienie.com/~masapico/api_ImageDirectoryEntryToData.html
+ *
+ * The formal way is
+ *   imagehlp.h or dbghelp.h
+ *   imagehlp.lib or dbghelp.lib
+ *   ImageDirectoryEntryToData()
+ */
+#define TO_DOS_HEADER(base) ((PIMAGE_DOS_HEADER)(base))
+#define TO_NT_HEADERS(base) ((PIMAGE_NT_HEADERS)((LPBYTE)(base) + TO_DOS_HEADER(base)->e_lfanew))
+static PVOID
+MyImageDirectoryEntryToData(LPVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size)
+{
+    /* TODO: MappedAsImage? */
+    PIMAGE_DATA_DIRECTORY p;
+    p = TO_NT_HEADERS(Base)->OptionalHeader.DataDirectory + DirectoryEntry;
+    if (p->VirtualAddress == 0) {
+      *Size = 0;
+      return NULL;
+    }
+    *Size = p->Size;
+    return (PVOID)((LPBYTE)Base + p->VirtualAddress);
+}
+
+static HMODULE
+find_imported_module_by_funcname(HMODULE hModule, const char *funcname)
+{
+    DWORD_PTR Base;
+    ULONG Size;
+    PIMAGE_IMPORT_DESCRIPTOR Imp;
+    PIMAGE_THUNK_DATA Name;         /* Import Name Table */
+    PIMAGE_IMPORT_BY_NAME ImpName;
+
+    Base = (DWORD_PTR)hModule;
+    Imp = (PIMAGE_IMPORT_DESCRIPTOR)MyImageDirectoryEntryToData(
+            (LPVOID)Base,
+            TRUE,
+            IMAGE_DIRECTORY_ENTRY_IMPORT,
+            &Size);
+    if (Imp == NULL)
+        return NULL;
+    for ( ; Imp->OriginalFirstThunk != 0; ++Imp)
+    {
+        Name = (PIMAGE_THUNK_DATA)(Base + Imp->OriginalFirstThunk);
+        for ( ; Name->u1.Ordinal != 0; ++Name)
+        {
+            if (!IMAGE_SNAP_BY_ORDINAL(Name->u1.Ordinal))
+            {
+                ImpName = (PIMAGE_IMPORT_BY_NAME)
+                    (Base + (DWORD_PTR)Name->u1.AddressOfData);
+                if (strcmp((char *)ImpName->Name, funcname) == 0)
+                    return GetModuleHandleA((char *)(Base + Imp->Name));
+            }
+        }
+    }
+    return NULL;
+}
+#endif
+
+static int
+sbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize)
+{
+    return 1;
+}
+
+static int
+dbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize)
+{
+    int len = IsDBCSLeadByteEx(cv->codepage, buf[0]) ? 2 : 1;
+    if (bufsize < len)
+        return seterror(EINVAL);
+    return len;
+}
+
+static int
+mbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize)
+{
+    int len = 0;
+
+    if (cv->codepage == 54936) {
+       if (buf[0] <= 0x7F) len = 1;
+       else if (buf[0] >= 0x81 && buf[0] <= 0xFE &&
+                bufsize >= 2 &&
+                ((buf[1] >= 0x40 && buf[1] <= 0x7E) ||
+                 (buf[1] >= 0x80 && buf[1] <= 0xFE))) len = 2;
+       else if (buf[0] >= 0x81 && buf[0] <= 0xFE &&
+                bufsize >= 4 &&
+                buf[1] >= 0x30 && buf[1] <= 0x39) len = 4;
+       else
+           return seterror(EINVAL);
+       return len;
+    }
+    else
+       return seterror(EINVAL);
+}
+
+static int
+utf8_mblen(csconv_t *cv, const uchar *buf, int bufsize)
+{
+    int len = 0;
+
+    if (buf[0] < 0x80) len = 1;
+    else if ((buf[0] & 0xE0) == 0xC0) len = 2;
+    else if ((buf[0] & 0xF0) == 0xE0) len = 3;
+    else if ((buf[0] & 0xF8) == 0xF0) len = 4;
+    else if ((buf[0] & 0xFC) == 0xF8) len = 5;
+    else if ((buf[0] & 0xFE) == 0xFC) len = 6;
+
+    if (len == 0)
+        return seterror(EILSEQ);
+    else if (bufsize < len)
+        return seterror(EINVAL);
+    return len;
+}
+
+static int
+eucjp_mblen(csconv_t *cv, const uchar *buf, int bufsize)
+{
+    if (buf[0] < 0x80) /* ASCII */
+        return 1;
+    else if (buf[0] == 0x8E) /* JIS X 0201 */
+    {
+        if (bufsize < 2)
+            return seterror(EINVAL);
+        else if (!(0xA1 <= buf[1] && buf[1] <= 0xDF))
+            return seterror(EILSEQ);
+        return 2;
+    }
+    else if (buf[0] == 0x8F) /* JIS X 0212 */
+    {
+        if (bufsize < 3)
+            return seterror(EINVAL);
+        else if (!(0xA1 <= buf[1] && buf[1] <= 0xFE)
+                || !(0xA1 <= buf[2] && buf[2] <= 0xFE))
+            return seterror(EILSEQ);
+        return 3;
+    }
+    else /* JIS X 0208 */
+    {
+        if (bufsize < 2)
+            return seterror(EINVAL);
+        else if (!(0xA1 <= buf[0] && buf[0] <= 0xFE)
+                || !(0xA1 <= buf[1] && buf[1] <= 0xFE))
+            return seterror(EILSEQ);
+        return 2;
+    }
+}
+
+static int
+kernel_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize)
+{
+    int len;
+
+    len = cv->mblen(cv, buf, bufsize);
+    if (len == -1)
+        return -1;
+    *wbufsize = MultiByteToWideChar(cv->codepage, mbtowc_flags (cv->codepage),
+            (const char *)buf, len, (wchar_t *)wbuf, *wbufsize);
+    if (*wbufsize == 0)
+        return seterror(EILSEQ);
+    return len;
+}
+
+static int
+kernel_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize)
+{
+    BOOL usedDefaultChar = 0;
+    BOOL *p = NULL;
+    int flags = 0;
+    int len;
+
+    if (bufsize == 0)
+        return seterror(E2BIG);
+    if (!must_use_null_useddefaultchar(cv->codepage))
+    {
+        p = &usedDefaultChar;
+#ifdef WC_NO_BEST_FIT_CHARS
+        if (!(cv->flags & FLAG_TRANSLIT))
+            flags |= WC_NO_BEST_FIT_CHARS;
+#endif
+    }
+    len = WideCharToMultiByte(cv->codepage, flags,
+            (const wchar_t *)wbuf, wbufsize, (char *)buf, bufsize, NULL, p);
+    if (len == 0)
+    {
+        if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
+            return seterror(E2BIG);
+        return seterror(EILSEQ);
+    }
+    else if (usedDefaultChar && !(cv->flags & FLAG_TRANSLIT))
+        return seterror(EILSEQ);
+    else if (cv->mblen(cv, buf, len) != len) /* validate result */
+        return seterror(EILSEQ);
+    return len;
+}
+
+/*
+ * It seems that the mode (cv->mode) is fixnum.
+ * For example, when converting iso-2022-jp(cp50221) to unicode:
+ *      in ascii sequence: mode=0xC42C0000
+ *   in jisx0208 sequence: mode=0xC42C0001
+ * "C42C" is same for each convert session.
+ * It should be: ((codepage-1)<<16)|state
+ */
+static int
+mlang_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize)
+{
+    int len;
+    int insize;
+    HRESULT hr;
+
+    len = cv->mblen(cv, buf, bufsize);
+    if (len == -1)
+        return -1;
+    insize = len;
+    hr = ConvertINetMultiByteToUnicode(&cv->mode, cv->codepage,
+            (const char *)buf, &insize, (wchar_t *)wbuf, wbufsize);
+    if (hr != S_OK || insize != len)
+        return seterror(EILSEQ);
+    return len;
+}
+
+static int
+mlang_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize)
+{
+    char tmpbuf[MB_CHAR_MAX]; /* enough room for one character */
+    int tmpsize = MB_CHAR_MAX;
+    int insize = wbufsize;
+    HRESULT hr;
+
+    hr = ConvertINetUnicodeToMultiByte(&cv->mode, cv->codepage,
+            (const wchar_t *)wbuf, &wbufsize, tmpbuf, &tmpsize);
+    if (hr != S_OK || insize != wbufsize)
+        return seterror(EILSEQ);
+    else if (bufsize < tmpsize)
+        return seterror(E2BIG);
+    else if (cv->mblen(cv, (uchar *)tmpbuf, tmpsize) != tmpsize)
+        return seterror(EILSEQ);
+    memcpy(buf, tmpbuf, tmpsize);
+    return tmpsize;
+}
+
+static int
+utf16_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize)
+{
+    int codepage = cv->codepage;
+
+    /* swap endian: 1200 <-> 1201 */
+    if (cv->mode & UNICODE_MODE_SWAPPED)
+        codepage ^= 1;
+
+    if (bufsize < 2)
+        return seterror(EINVAL);
+    if (codepage == 1200) /* little endian */
+        wbuf[0] = (buf[1] << 8) | buf[0];
+    else if (codepage == 1201) /* big endian */
+        wbuf[0] = (buf[0] << 8) | buf[1];
+
+    if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE))
+    {
+        cv->mode |= UNICODE_MODE_BOM_DONE;
+        if (wbuf[0] == 0xFFFE)
+        {
+            cv->mode |= UNICODE_MODE_SWAPPED;
+            *wbufsize = 0;
+            return 2;
+        }
+        else if (wbuf[0] == 0xFEFF)
+        {
+            *wbufsize = 0;
+            return 2;
+        }
+    }
+
+    if (0xDC00 <= wbuf[0] && wbuf[0] <= 0xDFFF)
+        return seterror(EILSEQ);
+    if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF)
+    {
+        if (bufsize < 4)
+            return seterror(EINVAL);
+        if (codepage == 1200) /* little endian */
+            wbuf[1] = (buf[3] << 8) | buf[2];
+        else if (codepage == 1201) /* big endian */
+            wbuf[1] = (buf[2] << 8) | buf[3];
+        if (!(0xDC00 <= wbuf[1] && wbuf[1] <= 0xDFFF))
+            return seterror(EILSEQ);
+        *wbufsize = 2;
+        return 4;
+    }
+    *wbufsize = 1;
+    return 2;
+}
+
+static int
+utf16_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize)
+{
+    if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE))
+    {
+        int r;
+
+        cv->mode |= UNICODE_MODE_BOM_DONE;
+        if (bufsize < 2)
+            return seterror(E2BIG);
+        if (cv->codepage == 1200) /* little endian */
+            memcpy(buf, "\xFF\xFE", 2);
+        else if (cv->codepage == 1201) /* big endian */
+            memcpy(buf, "\xFE\xFF", 2);
+
+        r = utf16_wctomb(cv, wbuf, wbufsize, buf + 2, bufsize - 2);
+        if (r == -1)
+            return -1;
+        return r + 2;
+    }
+
+    if (bufsize < 2)
+        return seterror(E2BIG);
+    if (cv->codepage == 1200) /* little endian */
+    {
+        buf[0] = (wbuf[0] & 0x00FF);
+        buf[1] = (wbuf[0] & 0xFF00) >> 8;
+    }
+    else if (cv->codepage == 1201) /* big endian */
+    {
+        buf[0] = (wbuf[0] & 0xFF00) >> 8;
+        buf[1] = (wbuf[0] & 0x00FF);
+    }
+    if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF)
+    {
+        if (bufsize < 4)
+            return seterror(E2BIG);
+        if (cv->codepage == 1200) /* little endian */
+        {
+            buf[2] = (wbuf[1] & 0x00FF);
+            buf[3] = (wbuf[1] & 0xFF00) >> 8;
+        }
+        else if (cv->codepage == 1201) /* big endian */
+        {
+            buf[2] = (wbuf[1] & 0xFF00) >> 8;
+            buf[3] = (wbuf[1] & 0x00FF);
+        }
+        return 4;
+    }
+    return 2;
+}
+
+static int
+utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize)
+{
+    int codepage = cv->codepage;
+    uint wc;
+
+    /* swap endian: 12000 <-> 12001 */
+    if (cv->mode & UNICODE_MODE_SWAPPED)
+        codepage ^= 1;
+
+    if (bufsize < 4)
+        return seterror(EINVAL);
+    if (codepage == 12000) /* little endian */
+        wc = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0];
+    else if (codepage == 12001) /* big endian */
+        wc = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
+
+    if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE))
+    {
+        cv->mode |= UNICODE_MODE_BOM_DONE;
+        if (wc == 0xFFFE0000)
+        {
+            cv->mode |= UNICODE_MODE_SWAPPED;
+            *wbufsize = 0;
+            return 4;
+        }
+        else if (wc == 0x0000FEFF)
+        {
+            *wbufsize = 0;
+            return 4;
+        }
+    }
+
+    if ((0xD800 <= wc && wc <= 0xDFFF) || 0x10FFFF < wc)
+        return seterror(EILSEQ);
+    ucs4_to_utf16(wc, wbuf, wbufsize);
+    return 4;
+}
+
+static int
+utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize)
+{
+    uint wc;
+
+    if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE))
+    {
+        int r;
+
+        cv->mode |= UNICODE_MODE_BOM_DONE;
+        if (bufsize < 4)
+            return seterror(E2BIG);
+        if (cv->codepage == 12000) /* little endian */
+            memcpy(buf, "\xFF\xFE\x00\x00", 4);
+        else if (cv->codepage == 12001) /* big endian */
+            memcpy(buf, "\x00\x00\xFE\xFF", 4);
+
+        r = utf32_wctomb(cv, wbuf, wbufsize, buf + 4, bufsize - 4);
+        if (r == -1)
+            return -1;
+        return r + 4;
+    }
+
+    if (bufsize < 4)
+        return seterror(E2BIG);
+    wc = utf16_to_ucs4(wbuf);
+    if (cv->codepage == 12000) /* little endian */
+    {
+        buf[0] = wc & 0x000000FF;
+        buf[1] = (wc & 0x0000FF00) >> 8;
+        buf[2] = (wc & 0x00FF0000) >> 16;
+        buf[3] = (wc & 0xFF000000) >> 24;
+    }
+    else if (cv->codepage == 12001) /* big endian */
+    {
+        buf[0] = (wc & 0xFF000000) >> 24;
+        buf[1] = (wc & 0x00FF0000) >> 16;
+        buf[2] = (wc & 0x0000FF00) >> 8;
+        buf[3] = wc & 0x000000FF;
+    }
+    return 4;
+}
+
+/*
+ * 50220: ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS)
+ * 50221: ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow
+ *        1 byte Kana)
+ * 50222: ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte
+ *        Kana - SO/SI)
+ *
+ * MultiByteToWideChar() and WideCharToMultiByte() behave differently
+ * depending on Windows version.  On XP, WideCharToMultiByte() doesn't
+ * terminate result sequence with ascii escape.  But Vista does.
+ * Use MLang instead.
+ */
+
+#define ISO2022_MODE(cs, shift) (((cs) << 8) | (shift))
+#define ISO2022_MODE_CS(mode) (((mode) >> 8) & 0xFF)
+#define ISO2022_MODE_SHIFT(mode) ((mode) & 0xFF)
+
+#define ISO2022_SI  0
+#define ISO2022_SO  1
+
+/* shift in */
+static const char iso2022_SI_seq[] = "\x0F";
+/* shift out */
+static const char iso2022_SO_seq[] = "\x0E";
+
+typedef struct iso2022_esc_t iso2022_esc_t;
+struct iso2022_esc_t {
+    const char *esc;
+    int esc_len;
+    int len;
+    int cs;
+};
+
+#define ISO2022JP_CS_ASCII            0
+#define ISO2022JP_CS_JISX0201_ROMAN   1
+#define ISO2022JP_CS_JISX0201_KANA    2
+#define ISO2022JP_CS_JISX0208_1978    3
+#define ISO2022JP_CS_JISX0208_1983    4
+#define ISO2022JP_CS_JISX0212         5
+
+static iso2022_esc_t iso2022jp_esc[] = {
+    {"\x1B\x28\x42", 3, 1, ISO2022JP_CS_ASCII},
+    {"\x1B\x28\x4A", 3, 1, ISO2022JP_CS_JISX0201_ROMAN},
+    {"\x1B\x28\x49", 3, 1, ISO2022JP_CS_JISX0201_KANA},
+    {"\x1B\x24\x40", 3, 2, ISO2022JP_CS_JISX0208_1983}, /* unify 1978 with 1983 */
+    {"\x1B\x24\x42", 3, 2, ISO2022JP_CS_JISX0208_1983},
+    {"\x1B\x24\x28\x44", 4, 2, ISO2022JP_CS_JISX0212},
+    {NULL, 0, 0, 0}
+};
+
+static int
+iso2022jp_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize)
+{
+    iso2022_esc_t *iesc = iso2022jp_esc;
+    char tmp[MB_CHAR_MAX];
+    int insize;
+    HRESULT hr;
+    DWORD dummy = 0;
+    int len;
+    int esc_len;
+    int cs;
+    int shift;
+    int i;
+
+    if (buf[0] == 0x1B)
+    {
+        for (i = 0; iesc[i].esc != NULL; ++i)
+        {
+            esc_len = iesc[i].esc_len;
+            if (bufsize < esc_len)
+            {
+                if (strncmp((char *)buf, iesc[i].esc, bufsize) == 0)
+                    return seterror(EINVAL);
+            }
+            else
+            {
+                if (strncmp((char *)buf, iesc[i].esc, esc_len) == 0)
+                {
+                    cv->mode = ISO2022_MODE(iesc[i].cs, ISO2022_SI);
+                    *wbufsize = 0;
+                    return esc_len;
+                }
+            }
+        }
+        /* not supported escape sequence */
+        return seterror(EILSEQ);
+    }
+    else if (buf[0] == iso2022_SO_seq[0])
+    {
+        cv->mode = ISO2022_MODE(ISO2022_MODE_CS(cv->mode), ISO2022_SO);
+        *wbufsize = 0;
+        return 1;
+    }
+    else if (buf[0] == iso2022_SI_seq[0])
+    {
+        cv->mode = ISO2022_MODE(ISO2022_MODE_CS(cv->mode), ISO2022_SI);
+        *wbufsize = 0;
+        return 1;
+    }
+
+    cs = ISO2022_MODE_CS(cv->mode);
+    shift = ISO2022_MODE_SHIFT(cv->mode);
+
+    /* reset the mode for informal sequence */
+    if (buf[0] < 0x20)
+    {
+        cs = ISO2022JP_CS_ASCII;
+        shift = ISO2022_SI;
+    }
+
+    len = iesc[cs].len;
+    if (bufsize < len)
+        return seterror(EINVAL);
+    for (i = 0; i < len; ++i)
+        if (!(buf[i] < 0x80))
+            return seterror(EILSEQ);
+    esc_len = iesc[cs].esc_len;
+    memcpy(tmp, iesc[cs].esc, esc_len);
+    if (shift == ISO2022_SO)
+    {
+        memcpy(tmp + esc_len, iso2022_SO_seq, 1);
+        esc_len += 1;
+    }
+    memcpy(tmp + esc_len, buf, len);
+
+    if ((cv->codepage == 50220 || cv->codepage == 50221
+                || cv->codepage == 50222) && shift == ISO2022_SO)
+    {
+        /* XXX: shift-out cannot be used for mbtowc (both kernel and
+         * mlang) */
+        esc_len = iesc[ISO2022JP_CS_JISX0201_KANA].esc_len;
+        memcpy(tmp, iesc[ISO2022JP_CS_JISX0201_KANA].esc, esc_len);
+        memcpy(tmp + esc_len, buf, len);
+    }
+
+    insize = len + esc_len;
+    hr = ConvertINetMultiByteToUnicode(&dummy, cv->codepage,
+            (const char *)tmp, &insize, (wchar_t *)wbuf, wbufsize);
+    if (hr != S_OK || insize != len + esc_len)
+        return seterror(EILSEQ);
+
+    /* Check for conversion error.  Assuming defaultChar is 0x3F. */
+    /* ascii should be converted from ascii */
+    if (wbuf[0] == buf[0]
+            && cv->mode != ISO2022_MODE(ISO2022JP_CS_ASCII, ISO2022_SI))
+        return seterror(EILSEQ);
+
+    /* reset the mode for informal sequence */
+    if (cv->mode != ISO2022_MODE(cs, shift))
+        cv->mode = ISO2022_MODE(cs, shift);
+
+    return len;
+}
+
+static int
+iso2022jp_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize)
+{
+    iso2022_esc_t *iesc = iso2022jp_esc;
+    char tmp[MB_CHAR_MAX];
+    int tmpsize = MB_CHAR_MAX;
+    int insize = wbufsize;
+    HRESULT hr;
+    DWORD dummy = 0;
+    int len;
+    int esc_len;
+    int cs;
+    int shift;
+    int i;
+
+    /*
+     * MultiByte = [escape sequence] + character + [escape sequence]
+     *
+     * Whether trailing escape sequence is added depends on which API is
+     * used (kernel or MLang, and its version).
+     */
+    hr = ConvertINetUnicodeToMultiByte(&dummy, cv->codepage,
+            (const wchar_t *)wbuf, &wbufsize, tmp, &tmpsize);
+    if (hr != S_OK || insize != wbufsize)
+        return seterror(EILSEQ);
+    else if (bufsize < tmpsize)
+        return seterror(E2BIG);
+
+    if (tmpsize == 1)
+    {
+        cs = ISO2022JP_CS_ASCII;
+        esc_len = 0;
+    }
+    else
+    {
+        for (i = 1; iesc[i].esc != NULL; ++i)
+        {
+            esc_len = iesc[i].esc_len;
+            if (strncmp(tmp, iesc[i].esc, esc_len) == 0)
+            {
+                cs = iesc[i].cs;
+                break;
+            }
+        }
+        if (iesc[i].esc == NULL)
+            /* not supported escape sequence */
+            return seterror(EILSEQ);
+    }
+
+    shift = ISO2022_SI;
+    if (tmp[esc_len] == iso2022_SO_seq[0])
+    {
+        shift = ISO2022_SO;
+        esc_len += 1;
+    }
+
+    len = iesc[cs].len;
+
+    /* Check for converting error.  Assuming defaultChar is 0x3F. */
+    /* ascii should be converted from ascii */
+    if (cs == ISO2022JP_CS_ASCII && !(wbuf[0] < 0x80))
+        return seterror(EILSEQ);
+    else if (tmpsize < esc_len + len)
+        return seterror(EILSEQ);
+
+    if (cv->mode == ISO2022_MODE(cs, shift))
+    {
+        /* remove escape sequence */
+        if (esc_len != 0)
+            memmove(tmp, tmp + esc_len, len);
+        esc_len = 0;
+    }
+    else
+    {
+        if (cs == ISO2022JP_CS_ASCII)
+        {
+            esc_len = iesc[ISO2022JP_CS_ASCII].esc_len;
+            memmove(tmp + esc_len, tmp, len);
+            memcpy(tmp, iesc[ISO2022JP_CS_ASCII].esc, esc_len);
+        }
+        if (ISO2022_MODE_SHIFT(cv->mode) == ISO2022_SO)
+        {
+            /* shift-in before changing to other mode */
+            memmove(tmp + 1, tmp, len + esc_len);
+            memcpy(tmp, iso2022_SI_seq, 1);
+            esc_len += 1;
+        }
+    }
+
+    if (bufsize < len + esc_len)
+        return seterror(E2BIG);
+    memcpy(buf, tmp, len + esc_len);
+    cv->mode = ISO2022_MODE(cs, shift);
+    return len + esc_len;
+}
+
+static int
+iso2022jp_flush(csconv_t *cv, uchar *buf, int bufsize)
+{
+    iso2022_esc_t *iesc = iso2022jp_esc;
+    int esc_len;
+
+    if (cv->mode != ISO2022_MODE(ISO2022JP_CS_ASCII, ISO2022_SI))
+    {
+        esc_len = 0;
+        if (ISO2022_MODE_SHIFT(cv->mode) != ISO2022_SI)
+            esc_len += 1;
+        if (ISO2022_MODE_CS(cv->mode) != ISO2022JP_CS_ASCII)
+            esc_len += iesc[ISO2022JP_CS_ASCII].esc_len;
+        if (bufsize < esc_len)
+            return seterror(E2BIG);
+
+        esc_len = 0;
+        if (ISO2022_MODE_SHIFT(cv->mode) != ISO2022_SI)
+        {
+            memcpy(buf, iso2022_SI_seq, 1);
+            esc_len += 1;
+        }
+        if (ISO2022_MODE_CS(cv->mode) != ISO2022JP_CS_ASCII)
+        {
+            memcpy(buf + esc_len, iesc[ISO2022JP_CS_ASCII].esc,
+                    iesc[ISO2022JP_CS_ASCII].esc_len);
+            esc_len += iesc[ISO2022JP_CS_ASCII].esc_len;
+        }
+        return esc_len;
+    }
+    return 0;
+}
+
+#if defined(MAKE_DLL) && defined(USE_LIBICONV_DLL)
+BOOL WINAPI
+DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
+{
+    switch( fdwReason )
+    {
+    case DLL_PROCESS_ATTACH:
+        hwiniconv = (HMODULE)hinstDLL;
+        break;
+    case DLL_THREAD_ATTACH:
+    case DLL_THREAD_DETACH:
+    case DLL_PROCESS_DETACH:
+        break;
+    }
+    return TRUE;
+}
+#endif
+
+#if defined(MAKE_EXE)
+#include <stdio.h>
+#include <fcntl.h>
+#include <io.h>
+int
+main(int argc, char **argv)
+{
+    char *fromcode = NULL;
+    char *tocode = NULL;
+    int i;
+    char inbuf[BUFSIZ];
+    char outbuf[BUFSIZ];
+    char *pin;
+    char *pout;
+    size_t inbytesleft;
+    size_t outbytesleft;
+    size_t rest = 0;
+    iconv_t cd;
+    size_t r;
+    FILE *in = stdin;
+    int ignore = 0;
+    char *p;
+
+    _setmode(_fileno(stdin), _O_BINARY);
+    _setmode(_fileno(stdout), _O_BINARY);
+
+    for (i = 1; i < argc; ++i)
+    {
+        if (strcmp(argv[i], "-l") == 0)
+        {
+            for (i = 0; codepage_alias[i].name != NULL; ++i)
+                printf("%s\n", codepage_alias[i].name);
+            return 0;
+        }
+
+        if (strcmp(argv[i], "-f") == 0)
+            fromcode = argv[++i];
+        else if (strcmp(argv[i], "-t") == 0)
+            tocode = argv[++i];
+        else if (strcmp(argv[i], "-c") == 0)
+            ignore = 1;
+        else
+        {
+            in = fopen(argv[i], "rb");
+            if (in == NULL)
+            {
+                fprintf(stderr, "cannot open %s\n", argv[i]);
+                return 1;
+            }
+            break;
+        }
+    }
+
+    if (fromcode == NULL || tocode == NULL)
+    {
+        printf("usage: %s [-c] -f from-enc -t to-enc [file]\n", argv[0]);
+        return 0;
+    }
+
+    if (ignore)
+    {
+        p = tocode;
+        tocode = (char *)malloc(strlen(p) + strlen("//IGNORE") + 1);
+        if (tocode == NULL)
+        {
+            perror("fatal error");
+            return 1;
+        }
+        strcpy(tocode, p);
+        strcat(tocode, "//IGNORE");
+    }
+
+    cd = iconv_open(tocode, fromcode);
+    if (cd == (iconv_t)(-1))
+    {
+        perror("iconv_open error");
+        return 1;
+    }
+
+    while ((inbytesleft = fread(inbuf + rest, 1, sizeof(inbuf) - rest, in)) != 0
+            || rest != 0)
+    {
+        inbytesleft += rest;
+        pin = inbuf;
+        pout = outbuf;
+        outbytesleft = sizeof(outbuf);
+        r = iconv(cd, &pin, &inbytesleft, &pout, &outbytesleft);
+        fwrite(outbuf, 1, sizeof(outbuf) - outbytesleft, stdout);
+        if (r == (size_t)(-1) && errno != E2BIG && (errno != EINVAL || feof(in)))
+        {
+            perror("conversion error");
+            return 1;
+        }
+        memmove(inbuf, pin, inbytesleft);
+        rest = inbytesleft;
+    }
+    pout = outbuf;
+    outbytesleft = sizeof(outbuf);
+    r = iconv(cd, NULL, NULL, &pout, &outbytesleft);
+    fwrite(outbuf, 1, sizeof(outbuf) - outbytesleft, stdout);
+    if (r == (size_t)(-1))
+    {
+        perror("conversion error");
+        return 1;
+    }
+
+    iconv_close(cd);
+
+    return 0;
+}
+#endif
+
diff --git a/libintl/postbuild.bat b/libintl/postbuild.bat
new file mode 100644 (file)
index 0000000..9d7732f
--- /dev/null
@@ -0,0 +1,21 @@
+rem post build batch file
+
+if "%1" == "" goto end
+
+rem set perl path
+set path=d:\perl64\bin;d:\devel\bin\;%path%
+
+rem copy lib files upto the lib folder
+
+if "%2" == "x64" goto x64
+:x86
+md ..\lib\x86
+copy /b /y %1 ..\lib\x86\
+goto end
+
+:x64
+md ..\lib\x64
+copy /b /y %1 ..\lib\x64\
+goto end
+
+:end
diff --git a/libintl/prebuild.bat b/libintl/prebuild.bat
new file mode 100644 (file)
index 0000000..433b6b8
--- /dev/null
@@ -0,0 +1,18 @@
+rem pre build batch file
+
+rem set perl path
+rem set path=d:\perl64\bin;d:\devel\bin\;%path%
+
+cd intl
+
+rem make libgnuintl.h
+rem perl ..\make_header.pl < libgnuintl.in.h > libgnuintl.h
+
+rem copy libgnuintl.h
+rem copy /y ..\msvc\libgnuintl.h .\
+
+rem plural.c file include in gettext-0.19.4 archive.
+rem bison plural.y -o plural.c
+
+cd ..
+
diff --git a/samples/copy_from_LC_MESSAGES.bat b/samples/copy_from_LC_MESSAGES.bat
new file mode 100644 (file)
index 0000000..15b5574
--- /dev/null
@@ -0,0 +1 @@
+for /d %%i in (locale\*) do copy /b /y %%i\LC_MESSAGES\hello-c.mo %%i\hello-c.mo 
\ No newline at end of file
diff --git a/samples/copy_to_LC_MESSAGES.bat b/samples/copy_to_LC_MESSAGES.bat
new file mode 100644 (file)
index 0000000..1e21694
--- /dev/null
@@ -0,0 +1 @@
+for /d %%i in (locale\*) do copy /b /y %%i\hello-c.mo %%i\LC_MESSAGES\hello-c.mo 
\ No newline at end of file
diff --git a/samples/get_lcid.cpp b/samples/get_lcid.cpp
new file mode 100644 (file)
index 0000000..37783f3
--- /dev/null
@@ -0,0 +1,37 @@
+
+#include <windows.h>
+#include <string.h>
+
+static const char *locale_for_search = NULL;
+static LCID decide_lcid = 0;
+
+static BOOL CALLBACK enum_lcids(LPSTR lcid_string)
+{
+       char language_name[64], country_name[64];
+       char *endp;
+       LCID lcid;
+
+       if (locale_for_search == NULL) {
+               return FALSE;
+       }
+
+       lcid = strtoul(lcid_string, &endp, 16);
+       GetLocaleInfoA(lcid, LOCALE_SENGLANGUAGE, language_name, sizeof(language_name));
+       endp = strrchr(language_name, '(');
+       if (endp != NULL) *endp = '\0';
+       GetLocaleInfoA(lcid, LOCALE_SENGCOUNTRY,  country_name, sizeof(country_name));
+       if (strstr(locale_for_search, language_name) != NULL && strstr(locale_for_search, country_name) != NULL) {
+               decide_lcid = lcid;
+               return FALSE;
+       }
+       return TRUE;
+}
+       
+LCID get_lcid(const char *locale)
+{
+       locale_for_search = locale;
+       decide_lcid = 0;
+       EnumSystemLocalesA(enum_lcids, LCID_SUPPORTED);
+       locale_for_search = NULL;
+       return decide_lcid;
+}
diff --git a/samples/get_lcid.h b/samples/get_lcid.h
new file mode 100644 (file)
index 0000000..6bc6841
--- /dev/null
@@ -0,0 +1,10 @@
+
+#pragma once
+
+#ifndef _GET_LCID_H_
+#define _GET_LCID_H_
+
+extern LCID get_lcid(const char *locale);
+
+#endif /* _GET_LCID_H_ */
+
diff --git a/samples/gettext.h b/samples/gettext.h
new file mode 100644 (file)
index 0000000..44bc1d9
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ *
+ */
+
+#pragma once
+
+#ifndef _GETTEXT_H_
+#define _GETTEXT_H_
+
+#include <windows.h>
+#include <stdio.h>
+/* #include <tchar.h> */
+/* #include <shlwapi.h> */
+
+#include "libintl.h"
+#if defined(UNICODE) || defined(_UNICODE)
+#ifdef _DEBUG
+#pragma comment(lib, "libintlud.lib")
+#else
+#pragma comment(lib, "libintlu.lib")
+#endif
+#include "wlibintl.h"
+#else
+#ifdef _DEBUG
+#pragma comment(lib, "libintld.lib")
+#else
+#pragma comment(lib, "libintl.lib")
+#endif
+#endif
+
+#if defined(UNICODE) || defined(_UNICODE)
+/* if variable string, use _tgettext instead of _(). */
+#define _(text) wgettext(L##text)
+#define _tgettext wgettext
+#define _tdgettext dwgettext
+#define _tdcgettext dcwgettext
+#define _tngettext nwgettext
+#define _tdngettext dnwgettext
+#define _tdcngettext dcnwgettext
+
+#define _tbindtextdomain wbindtextdomain
+#define _tbind_textdomain_codeset wbind_textdomain_codeset
+
+#define _ttextdomain wtextdomain
+
+#define libintl_tfreeres libintl_wfreeres
+#else /* MBCS */
+#define _(text) gettext(text)
+#define _tgettext gettext
+#define _tdgettext dgettext
+#define _tdcgettext dcgettext
+#define _tngettext ngettext
+#define _tdngettext dngettext
+#define _tdcngettext dcngettext
+
+#define _tbindtextdomain bindtextdomain
+#define _tbind_textdomain_codeset wbind_textdomain_codeset
+
+#define _ttextdomain textdomain
+
+#define libintl_tfreeres libintl_freeres
+#endif
+
+#endif /* _GETTEXT_H_ */
diff --git a/samples/locale/af/LC_MESSAGES/hello-c.mo b/samples/locale/af/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..0edb665
Binary files /dev/null and b/samples/locale/af/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/af/hello-c.mo b/samples/locale/af/hello-c.mo
new file mode 100644 (file)
index 0000000..0edb665
Binary files /dev/null and b/samples/locale/af/hello-c.mo differ
diff --git a/samples/locale/ca/LC_MESSAGES/hello-c.mo b/samples/locale/ca/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..9c559ab
Binary files /dev/null and b/samples/locale/ca/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/ca/hello-c.mo b/samples/locale/ca/hello-c.mo
new file mode 100644 (file)
index 0000000..9c559ab
Binary files /dev/null and b/samples/locale/ca/hello-c.mo differ
diff --git a/samples/locale/de/LC_MESSAGES/hello-c.mo b/samples/locale/de/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..b95f07b
Binary files /dev/null and b/samples/locale/de/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/de/hello-c.mo b/samples/locale/de/hello-c.mo
new file mode 100644 (file)
index 0000000..b95f07b
Binary files /dev/null and b/samples/locale/de/hello-c.mo differ
diff --git a/samples/locale/el/LC_MESSAGES/hello-c.mo b/samples/locale/el/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..ffc792b
Binary files /dev/null and b/samples/locale/el/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/el/hello-c.mo b/samples/locale/el/hello-c.mo
new file mode 100644 (file)
index 0000000..ffc792b
Binary files /dev/null and b/samples/locale/el/hello-c.mo differ
diff --git a/samples/locale/eo/LC_MESSAGES/hello-c.mo b/samples/locale/eo/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..534c07f
Binary files /dev/null and b/samples/locale/eo/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/eo/hello-c.mo b/samples/locale/eo/hello-c.mo
new file mode 100644 (file)
index 0000000..534c07f
Binary files /dev/null and b/samples/locale/eo/hello-c.mo differ
diff --git a/samples/locale/es/LC_MESSAGES/hello-c.mo b/samples/locale/es/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..ce541e9
Binary files /dev/null and b/samples/locale/es/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/es/hello-c.mo b/samples/locale/es/hello-c.mo
new file mode 100644 (file)
index 0000000..ce541e9
Binary files /dev/null and b/samples/locale/es/hello-c.mo differ
diff --git a/samples/locale/fi/LC_MESSAGES/hello-c.mo b/samples/locale/fi/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..e7ba8de
Binary files /dev/null and b/samples/locale/fi/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/fi/hello-c.mo b/samples/locale/fi/hello-c.mo
new file mode 100644 (file)
index 0000000..e7ba8de
Binary files /dev/null and b/samples/locale/fi/hello-c.mo differ
diff --git a/samples/locale/fr/LC_MESSAGES/hello-c.mo b/samples/locale/fr/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..f653779
Binary files /dev/null and b/samples/locale/fr/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/fr/hello-c.mo b/samples/locale/fr/hello-c.mo
new file mode 100644 (file)
index 0000000..f653779
Binary files /dev/null and b/samples/locale/fr/hello-c.mo differ
diff --git a/samples/locale/ga/LC_MESSAGES/hello-c.mo b/samples/locale/ga/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..76e69fa
Binary files /dev/null and b/samples/locale/ga/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/ga/hello-c.mo b/samples/locale/ga/hello-c.mo
new file mode 100644 (file)
index 0000000..76e69fa
Binary files /dev/null and b/samples/locale/ga/hello-c.mo differ
diff --git a/samples/locale/hu/LC_MESSAGES/hello-c.mo b/samples/locale/hu/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..ec71586
Binary files /dev/null and b/samples/locale/hu/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/hu/hello-c.mo b/samples/locale/hu/hello-c.mo
new file mode 100644 (file)
index 0000000..ec71586
Binary files /dev/null and b/samples/locale/hu/hello-c.mo differ
diff --git a/samples/locale/id/LC_MESSAGES/hello-c.mo b/samples/locale/id/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..bd67e71
Binary files /dev/null and b/samples/locale/id/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/id/hello-c.mo b/samples/locale/id/hello-c.mo
new file mode 100644 (file)
index 0000000..bd67e71
Binary files /dev/null and b/samples/locale/id/hello-c.mo differ
diff --git a/samples/locale/it/LC_MESSAGES/hello-c.mo b/samples/locale/it/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..a170342
Binary files /dev/null and b/samples/locale/it/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/it/hello-c.mo b/samples/locale/it/hello-c.mo
new file mode 100644 (file)
index 0000000..a170342
Binary files /dev/null and b/samples/locale/it/hello-c.mo differ
diff --git a/samples/locale/ja/LC_MESSAGES/hello-c.mo b/samples/locale/ja/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..615f699
Binary files /dev/null and b/samples/locale/ja/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/ja/hello-c.mo b/samples/locale/ja/hello-c.mo
new file mode 100644 (file)
index 0000000..615f699
Binary files /dev/null and b/samples/locale/ja/hello-c.mo differ
diff --git a/samples/locale/ky/LC_MESSAGES/hello-c.mo b/samples/locale/ky/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..c6fd6d4
Binary files /dev/null and b/samples/locale/ky/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/ky/hello-c.mo b/samples/locale/ky/hello-c.mo
new file mode 100644 (file)
index 0000000..c6fd6d4
Binary files /dev/null and b/samples/locale/ky/hello-c.mo differ
diff --git a/samples/locale/lv/LC_MESSAGES/hello-c.mo b/samples/locale/lv/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..70da9d7
Binary files /dev/null and b/samples/locale/lv/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/lv/hello-c.mo b/samples/locale/lv/hello-c.mo
new file mode 100644 (file)
index 0000000..70da9d7
Binary files /dev/null and b/samples/locale/lv/hello-c.mo differ
diff --git a/samples/locale/ms/LC_MESSAGES/hello-c.mo b/samples/locale/ms/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..b0a5b75
Binary files /dev/null and b/samples/locale/ms/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/ms/hello-c.mo b/samples/locale/ms/hello-c.mo
new file mode 100644 (file)
index 0000000..b0a5b75
Binary files /dev/null and b/samples/locale/ms/hello-c.mo differ
diff --git a/samples/locale/nl/LC_MESSAGES/hello-c.mo b/samples/locale/nl/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..337d5c6
Binary files /dev/null and b/samples/locale/nl/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/nl/hello-c.mo b/samples/locale/nl/hello-c.mo
new file mode 100644 (file)
index 0000000..337d5c6
Binary files /dev/null and b/samples/locale/nl/hello-c.mo differ
diff --git a/samples/locale/pl/LC_MESSAGES/hello-c.mo b/samples/locale/pl/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..63fe0bf
Binary files /dev/null and b/samples/locale/pl/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/pl/hello-c.mo b/samples/locale/pl/hello-c.mo
new file mode 100644 (file)
index 0000000..63fe0bf
Binary files /dev/null and b/samples/locale/pl/hello-c.mo differ
diff --git a/samples/locale/pt/LC_MESSAGES/hello-c.mo b/samples/locale/pt/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..279314a
Binary files /dev/null and b/samples/locale/pt/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/pt/hello-c.mo b/samples/locale/pt/hello-c.mo
new file mode 100644 (file)
index 0000000..279314a
Binary files /dev/null and b/samples/locale/pt/hello-c.mo differ
diff --git a/samples/locale/ro/LC_MESSAGES/hello-c.mo b/samples/locale/ro/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..1e50cb7
Binary files /dev/null and b/samples/locale/ro/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/ro/hello-c.mo b/samples/locale/ro/hello-c.mo
new file mode 100644 (file)
index 0000000..1e50cb7
Binary files /dev/null and b/samples/locale/ro/hello-c.mo differ
diff --git a/samples/locale/ru/LC_MESSAGES/hello-c.mo b/samples/locale/ru/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..cf671fa
Binary files /dev/null and b/samples/locale/ru/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/ru/hello-c.mo b/samples/locale/ru/hello-c.mo
new file mode 100644 (file)
index 0000000..cf671fa
Binary files /dev/null and b/samples/locale/ru/hello-c.mo differ
diff --git a/samples/locale/sk/LC_MESSAGES/hello-c.mo b/samples/locale/sk/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..17e5b9e
Binary files /dev/null and b/samples/locale/sk/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/sk/hello-c.mo b/samples/locale/sk/hello-c.mo
new file mode 100644 (file)
index 0000000..17e5b9e
Binary files /dev/null and b/samples/locale/sk/hello-c.mo differ
diff --git a/samples/locale/sl/LC_MESSAGES/hello-c.mo b/samples/locale/sl/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..ac12573
Binary files /dev/null and b/samples/locale/sl/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/sl/hello-c.mo b/samples/locale/sl/hello-c.mo
new file mode 100644 (file)
index 0000000..ac12573
Binary files /dev/null and b/samples/locale/sl/hello-c.mo differ
diff --git a/samples/locale/sr/LC_MESSAGES/hello-c.mo b/samples/locale/sr/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..2a3a5e9
Binary files /dev/null and b/samples/locale/sr/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/sr/hello-c.mo b/samples/locale/sr/hello-c.mo
new file mode 100644 (file)
index 0000000..2a3a5e9
Binary files /dev/null and b/samples/locale/sr/hello-c.mo differ
diff --git a/samples/locale/sv/LC_MESSAGES/hello-c.mo b/samples/locale/sv/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..8a2d2d5
Binary files /dev/null and b/samples/locale/sv/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/sv/hello-c.mo b/samples/locale/sv/hello-c.mo
new file mode 100644 (file)
index 0000000..8a2d2d5
Binary files /dev/null and b/samples/locale/sv/hello-c.mo differ
diff --git a/samples/locale/tr/LC_MESSAGES/hello-c.mo b/samples/locale/tr/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..78679b8
Binary files /dev/null and b/samples/locale/tr/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/tr/hello-c.mo b/samples/locale/tr/hello-c.mo
new file mode 100644 (file)
index 0000000..78679b8
Binary files /dev/null and b/samples/locale/tr/hello-c.mo differ
diff --git a/samples/locale/uk/LC_MESSAGES/hello-c.mo b/samples/locale/uk/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..96b4e1c
Binary files /dev/null and b/samples/locale/uk/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/uk/hello-c.mo b/samples/locale/uk/hello-c.mo
new file mode 100644 (file)
index 0000000..96b4e1c
Binary files /dev/null and b/samples/locale/uk/hello-c.mo differ
diff --git a/samples/locale/vi/LC_MESSAGES/hello-c.mo b/samples/locale/vi/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..b1b3336
Binary files /dev/null and b/samples/locale/vi/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/vi/hello-c.mo b/samples/locale/vi/hello-c.mo
new file mode 100644 (file)
index 0000000..b1b3336
Binary files /dev/null and b/samples/locale/vi/hello-c.mo differ
diff --git a/samples/locale/zh_CN/LC_MESSAGES/hello-c.mo b/samples/locale/zh_CN/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..7131743
Binary files /dev/null and b/samples/locale/zh_CN/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/zh_CN/hello-c.mo b/samples/locale/zh_CN/hello-c.mo
new file mode 100644 (file)
index 0000000..7131743
Binary files /dev/null and b/samples/locale/zh_CN/hello-c.mo differ
diff --git a/samples/locale/zh_HK/LC_MESSAGES/hello-c.mo b/samples/locale/zh_HK/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..5e1219b
Binary files /dev/null and b/samples/locale/zh_HK/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/zh_HK/hello-c.mo b/samples/locale/zh_HK/hello-c.mo
new file mode 100644 (file)
index 0000000..5e1219b
Binary files /dev/null and b/samples/locale/zh_HK/hello-c.mo differ
diff --git a/samples/locale/zh_TW/LC_MESSAGES/hello-c.mo b/samples/locale/zh_TW/LC_MESSAGES/hello-c.mo
new file mode 100644 (file)
index 0000000..6d4d8cd
Binary files /dev/null and b/samples/locale/zh_TW/LC_MESSAGES/hello-c.mo differ
diff --git a/samples/locale/zh_TW/hello-c.mo b/samples/locale/zh_TW/hello-c.mo
new file mode 100644 (file)
index 0000000..6d4d8cd
Binary files /dev/null and b/samples/locale/zh_TW/hello-c.mo differ
diff --git a/samples/sample-console/sample.cpp b/samples/sample-console/sample.cpp
new file mode 100644 (file)
index 0000000..df36b56
--- /dev/null
@@ -0,0 +1,88 @@
+#include <windows.h>
+//#include <vector>
+#include <fstream>
+#include <tchar.h>
+#include <shlwapi.h>
+#ifdef _MSC_VER
+#pragma comment(lib, "shlwapi.lib")
+#endif
+#include <process.h>
+#include "../gettext.h"
+#include "../get_lcid.h"
+
+#define PACKAGE_NAME _T("hello-c")
+
+#ifdef _DEBUG
+#define _CRTDBG_MAP_ALLOC
+#include <crtdbg.h>
+#endif
+
+int _tmain() {
+       const char *locale = setlocale(LC_ALL, "de");
+       if (locale == NULL) {
+               locale = setlocale(LC_ALL, "");
+               return 1;
+       }
+       LCID lcid = get_lcid(locale);
+       SetThreadLocale(lcid);
+
+       TCHAR locale_dir[3000];
+       DWORD result = GetModuleFileName(GetModuleHandle(NULL), 
+                                                                       locale_dir, sizeof(locale_dir)/sizeof(TCHAR) - 1);
+
+       if (result == 0 || result > 2950) {
+               return 1;
+       }
+
+       if (PathRemoveFileSpec(&locale_dir[0]) == FALSE) {
+               return 1;
+       }
+       TCHAR *p = _tcsstr(locale_dir, _T("sample-"));
+       if (p != NULL) {
+               *p = 0;
+       }
+
+       const TCHAR dir[] = _T("locale");
+       if (PathAppend(&locale_dir[0], dir) == FALSE) {
+               return 1;
+       }
+
+#if defined(UNICODE) || defined(_UNICODE)
+       _putws(L"UNICODE");
+       if (wbindtextdomain(PACKAGE_NAME, locale_dir) == NULL) {
+               return 1;
+       }
+       if (wbind_textdomain_codeset(PACKAGE_NAME, _T("UTF-16LE")) == NULL) {
+               return 1;
+       }
+#else
+       puts("MBCS");
+       if (bindtextdomain(PACKAGE_NAME, locale_dir) == NULL) {
+               return 1;
+       }
+#endif
+
+       if (_ttextdomain(PACKAGE_NAME) == NULL) {
+               return 1;
+       }
+
+       _putts(_("Hello, world!"));
+       MessageBox(NULL, _("Hello, world!"), locale_dir, MB_OK);
+
+       _TCHAR msg[3000];
+       _stprintf(msg, _("This program is running as process number %d."), _getpid());
+
+       _putts(msg);
+       MessageBox(NULL, msg, locale_dir, MB_OK);
+
+       // free all resources in libintl library
+       libintl_tfreeres();
+
+end:
+#ifdef _DEBUG
+       _CrtDumpMemoryLeaks();
+#endif
+
+       return 0;
+}
+
diff --git a/samples/sample-console/sample.vcproj b/samples/sample-console/sample.vcproj
new file mode 100644 (file)
index 0000000..3464efb
--- /dev/null
@@ -0,0 +1,683 @@
+<?xml version="1.0" encoding="shift_jis"?>
+<VisualStudioProject
+       ProjectType="Visual C++"
+       Version="9.00"
+       Name="sample"
+       ProjectGUID="{ACA9A537-CBCE-44B8-BD52-8C432BD529C2}"
+       RootNamespace="sample"
+       Keyword="Win32Proj"
+       TargetFrameworkVersion="196613"
+       >
+       <Platforms>
+               <Platform
+                       Name="Win32"
+               />
+               <Platform
+                       Name="x64"
+               />
+       </Platforms>
+       <ToolFiles>
+       </ToolFiles>
+       <Configurations>
+               <Configuration
+                       Name="Debug|Win32"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="1"
+                       CharacterSet="2"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="..\..\include\"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="4"
+                               EnablePREfast="false"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="libintld.lib"
+                               OutputFile="$(OutDir)\$(SolutionName).exe"
+                               LinkIncremental="2"
+                               AdditionalLibraryDirectories="..\..\lib\x86\"
+                               GenerateDebugInformation="true"
+                               SubSystem="1"
+                               TargetMachine="1"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Release|Win32"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="1"
+                       CharacterSet="2"
+                       WholeProgramOptimization="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="2"
+                               EnableIntrinsicFunctions="true"
+                               AdditionalIncludeDirectories="..\..\include\"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+                               RuntimeLibrary="2"
+                               EnableFunctionLevelLinking="true"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="libintl.lib"
+                               OutputFile="$(OutDir)\$(SolutionName).exe"
+                               LinkIncremental="1"
+                               AdditionalLibraryDirectories="..\..\lib\x86\"
+                               GenerateDebugInformation="true"
+                               SubSystem="1"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               TargetMachine="1"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Unicode_Debug|Win32"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="1"
+                       CharacterSet="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="..\..\include\"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="4"
+                               EnablePREfast="false"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="libintlud.lib"
+                               OutputFile="$(OutDir)\$(SolutionName).exe"
+                               LinkIncremental="2"
+                               AdditionalLibraryDirectories="..\..\lib\x86\"
+                               GenerateDebugInformation="true"
+                               SubSystem="1"
+                               TargetMachine="1"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Unicode_Release|Win32"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="1"
+                       CharacterSet="2"
+                       WholeProgramOptimization="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="2"
+                               EnableIntrinsicFunctions="true"
+                               AdditionalIncludeDirectories="..\..\include\"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+                               RuntimeLibrary="2"
+                               EnableFunctionLevelLinking="true"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="libintlu.lib"
+                               OutputFile="$(OutDir)\$(SolutionName).exe"
+                               LinkIncremental="1"
+                               AdditionalLibraryDirectories="..\..\lib\x86\"
+                               GenerateDebugInformation="true"
+                               SubSystem="1"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               TargetMachine="1"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Debug|x64"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="1"
+                       CharacterSet="2"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="..\..\include\"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                               EnablePREfast="false"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="libintld.lib"
+                               OutputFile="$(OutDir)\$(SolutionName).exe"
+                               LinkIncremental="2"
+                               AdditionalLibraryDirectories="..\..\lib\x64\"
+                               GenerateDebugInformation="true"
+                               SubSystem="1"
+                               TargetMachine="17"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Release|x64"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="1"
+                       CharacterSet="2"
+                       WholeProgramOptimization="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="2"
+                               EnableIntrinsicFunctions="true"
+                               AdditionalIncludeDirectories="..\..\include\"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+                               RuntimeLibrary="2"
+                               EnableFunctionLevelLinking="true"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="libintl.lib"
+                               OutputFile="$(OutDir)\$(SolutionName).exe"
+                               LinkIncremental="1"
+                               AdditionalLibraryDirectories="..\..\lib\x64\"
+                               GenerateDebugInformation="true"
+                               SubSystem="1"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               TargetMachine="17"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Unicode_Debug|x64"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="1"
+                       CharacterSet="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="..\..\include\"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                               EnablePREfast="false"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="libintlud.lib"
+                               OutputFile="$(OutDir)\$(SolutionName).exe"
+                               LinkIncremental="2"
+                               AdditionalLibraryDirectories="..\..\lib\x64\"
+                               GenerateDebugInformation="true"
+                               SubSystem="1"
+                               TargetMachine="17"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Unicode_Release|x64"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="1"
+                       CharacterSet="1"
+                       WholeProgramOptimization="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="2"
+                               EnableIntrinsicFunctions="true"
+                               AdditionalIncludeDirectories="..\..\include\"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+                               RuntimeLibrary="2"
+                               EnableFunctionLevelLinking="true"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="libintlu.lib"
+                               OutputFile="$(OutDir)\$(SolutionName).exe"
+                               LinkIncremental="1"
+                               AdditionalLibraryDirectories="..\..\lib\x64\"
+                               GenerateDebugInformation="true"
+                               SubSystem="1"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               TargetMachine="17"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+       </Configurations>
+       <References>
+       </References>
+       <Files>
+               <Filter
+                       Name="Source File"
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+                       >
+                       <File
+                               RelativePath="..\get_lcid.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\sample.cpp"
+                               >
+                       </File>
+               </Filter>
+               <Filter
+                       Name="Header File"
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+                       >
+                       <File
+                               RelativePath="..\get_lcid.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\gettext.h"
+                               >
+                       </File>
+               </Filter>
+               <Filter
+                       Name="Resource File"
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+                       >
+               </Filter>
+       </Files>
+       <Globals>
+       </Globals>
+</VisualStudioProject>
diff --git a/samples/sample-console/sample.vcxproj b/samples/sample-console/sample.vcxproj
new file mode 100644 (file)
index 0000000..226d069
--- /dev/null
@@ -0,0 +1,312 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Unicode_Debug|Win32">
+      <Configuration>Unicode_Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Unicode_Debug|x64">
+      <Configuration>Unicode_Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Unicode_Release|Win32">
+      <Configuration>Unicode_Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Unicode_Release|x64">
+      <Configuration>Unicode_Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{ACA9A537-CBCE-44B8-BD52-8C432BD529C2}</ProjectGuid>
+    <RootNamespace>sample</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
+    <ProjectName>sample</ProjectName>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|Win32'">true</LinkIncremental>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|x64'">true</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|Win32'">false</LinkIncremental>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|x64'">false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+      <EnablePREfast>false</EnablePREfast>
+      <AdditionalIncludeDirectories>..\..\include\</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Console</SubSystem>
+      <TargetMachine>MachineX86</TargetMachine>
+      <AdditionalLibraryDirectories>..\..\lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|Win32'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+      <EnablePREfast>false</EnablePREfast>
+      <AdditionalIncludeDirectories>..\..\include\</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Console</SubSystem>
+      <TargetMachine>MachineX86</TargetMachine>
+      <AdditionalLibraryDirectories>..\..\lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <EnablePREfast>false</EnablePREfast>
+      <AdditionalIncludeDirectories>..\..\include\</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Console</SubSystem>
+      <AdditionalLibraryDirectories>..\..\lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|x64'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <EnablePREfast>false</EnablePREfast>
+      <AdditionalIncludeDirectories>..\..\include\</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Console</SubSystem>
+      <AdditionalLibraryDirectories>..\..\lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <Optimization>MaxSpeed</Optimization>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <AdditionalIncludeDirectories>..\..\include\</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>false</GenerateDebugInformation>
+      <SubSystem>Console</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <TargetMachine>MachineX86</TargetMachine>
+      <AdditionalLibraryDirectories>..\..\lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|Win32'">
+    <ClCompile>
+      <Optimization>MaxSpeed</Optimization>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <AdditionalIncludeDirectories>..\..\include\</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Console</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <TargetMachine>MachineX86</TargetMachine>
+      <AdditionalLibraryDirectories>..\..\lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <Optimization>MaxSpeed</Optimization>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <AdditionalIncludeDirectories>..\..\include\</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>false</GenerateDebugInformation>
+      <SubSystem>Console</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <AdditionalLibraryDirectories>..\..\lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|x64'">
+    <ClCompile>
+      <Optimization>MaxSpeed</Optimization>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <AdditionalIncludeDirectories>..\..\include\</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Console</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <AdditionalLibraryDirectories>..\..\lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="..\get_lcid.cpp" />
+    <ClCompile Include="sample.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\gettext.h" />
+    <ClInclude Include="..\get_lcid.h" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/samples/sample-console/sample.vcxproj.filters b/samples/sample-console/sample.vcxproj.filters
new file mode 100644 (file)
index 0000000..37345e5
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source File">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header File">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource File">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="sample.cpp">
+      <Filter>Source File</Filter>
+    </ClCompile>
+    <ClCompile Include="..\get_lcid.cpp">
+      <Filter>Source File</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\gettext.h">
+      <Filter>Header File</Filter>
+    </ClInclude>
+    <ClInclude Include="..\get_lcid.h">
+      <Filter>Header File</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/samples/sample-console/sample_vc09.sln b/samples/sample-console/sample_vc09.sln
new file mode 100644 (file)
index 0000000..7a563c9
--- /dev/null
@@ -0,0 +1,38 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample", "sample.vcproj", "{ACA9A537-CBCE-44B8-BD52-8C432BD529C2}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Debug|x64 = Debug|x64
+               Release|Win32 = Release|Win32
+               Release|x64 = Release|x64
+               Unicode_Debug|Win32 = Unicode_Debug|Win32
+               Unicode_Debug|x64 = Unicode_Debug|x64
+               Unicode_Release|Win32 = Unicode_Release|Win32
+               Unicode_Release|x64 = Unicode_Release|x64
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Debug|Win32.ActiveCfg = Debug|Win32
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Debug|Win32.Build.0 = Debug|Win32
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Debug|x64.ActiveCfg = Debug|x64
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Debug|x64.Build.0 = Debug|x64
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Release|Win32.ActiveCfg = Release|Win32
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Release|Win32.Build.0 = Release|Win32
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Release|x64.ActiveCfg = Release|x64
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Release|x64.Build.0 = Release|x64
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Unicode_Debug|Win32.ActiveCfg = Unicode_Debug|Win32
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Unicode_Debug|Win32.Build.0 = Unicode_Debug|Win32
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Unicode_Debug|x64.ActiveCfg = Unicode_Debug|x64
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Unicode_Debug|x64.Build.0 = Unicode_Debug|x64
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Unicode_Release|Win32.ActiveCfg = Unicode_Release|Win32
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Unicode_Release|Win32.Build.0 = Unicode_Release|Win32
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Unicode_Release|x64.ActiveCfg = Unicode_Release|x64
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Unicode_Release|x64.Build.0 = Unicode_Release|x64
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/samples/sample-console/sample_vc10.sln b/samples/sample-console/sample_vc10.sln
new file mode 100644 (file)
index 0000000..5a83252
--- /dev/null
@@ -0,0 +1,38 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual C++ Express 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample", "sample.vcxproj", "{ACA9A537-CBCE-44B8-BD52-8C432BD529C2}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Debug|x64 = Debug|x64
+               Release|Win32 = Release|Win32
+               Release|x64 = Release|x64
+               Unicode_Debug|Win32 = Unicode_Debug|Win32
+               Unicode_Debug|x64 = Unicode_Debug|x64
+               Unicode_Release|Win32 = Unicode_Release|Win32
+               Unicode_Release|x64 = Unicode_Release|x64
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Debug|Win32.ActiveCfg = Debug|Win32
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Debug|Win32.Build.0 = Debug|Win32
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Debug|x64.ActiveCfg = Debug|x64
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Debug|x64.Build.0 = Debug|x64
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Release|Win32.ActiveCfg = Release|Win32
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Release|Win32.Build.0 = Release|Win32
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Release|x64.ActiveCfg = Release|x64
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Release|x64.Build.0 = Release|x64
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Unicode_Debug|Win32.ActiveCfg = Unicode_Debug|Win32
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Unicode_Debug|Win32.Build.0 = Unicode_Debug|Win32
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Unicode_Debug|x64.ActiveCfg = Unicode_Debug|x64
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Unicode_Debug|x64.Build.0 = Unicode_Debug|x64
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Unicode_Release|Win32.ActiveCfg = Unicode_Release|Win32
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Unicode_Release|Win32.Build.0 = Unicode_Release|Win32
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Unicode_Release|x64.ActiveCfg = Unicode_Release|x64
+               {ACA9A537-CBCE-44B8-BD52-8C432BD529C2}.Unicode_Release|x64.Build.0 = Unicode_Release|x64
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/samples/sample-winapp/Resource.h b/samples/sample-winapp/Resource.h
new file mode 100644 (file)
index 0000000..3548851
--- /dev/null
@@ -0,0 +1,14 @@
+
+#define IDS_APP_TITLE                  103
+
+#define IDR_MAINFRAME                  128
+#define IDD_SAMPLEWINAPP_DIALOG        102
+#define IDD_ABOUTBOX                   103
+#define IDM_ABOUT                              104
+#define IDM_EXIT                               105
+#define IDI_SAMPLEWINAPP                       107
+#define IDC_SAMPLEWINAPP                       109
+#define IDC_MYICON                             2
+#ifndef IDC_STATIC
+#define IDC_STATIC                             -1
+#endif
diff --git a/samples/sample-winapp/sample-winapp.cpp b/samples/sample-winapp/sample-winapp.cpp
new file mode 100644 (file)
index 0000000..6c5287c
--- /dev/null
@@ -0,0 +1,648 @@
+//
+//
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <stdlib.h>
+#include <malloc.h>
+#include <memory.h>
+#include <tchar.h>
+#include <process.h>
+#include <shlwapi.h>
+#ifdef _MSC_VER
+#pragma comment(lib, "shlwapi.lib")
+#endif
+
+#include "sample-winapp.h"
+#include "../gettext.h"
+#include "../get_lcid.h"
+
+#define PACKAGE_NAME _T("hello-c")
+
+#ifdef _DEBUG
+#define _CRTDBG_MAP_ALLOC
+#include <crtdbg.h>
+#endif
+
+#define MAX_LOADSTRING 100
+
+// global variables
+HINSTANCE hInst;                                                               // My Instance
+TCHAR szTitle[MAX_LOADSTRING];                                 // Text of title bar
+TCHAR szWindowClass[MAX_LOADSTRING];                   // main window class name
+
+HWND hCtrls[12];
+int iCtrlsCnt = 0;
+int iCtrlFontName = 9;
+int iCtrlFontSize = 9;
+int iCtrlLang = 9;
+int iCtrlBtnChange = 9;
+
+HFONT hFont = NULL;
+_TCHAR font_name[_MAX_PATH];
+double font_size = 0.0;
+char   lang_name[_MAX_PATH];
+bool   lang_ok = false;
+
+// prototype definition
+ATOM                           MyRegisterClass(HINSTANCE hInstance);
+BOOL                           InitInstance(HINSTANCE, int);
+LRESULT CALLBACK       WndProc(HWND, UINT, WPARAM, LPARAM);
+INT_PTR CALLBACK       About(HWND, UINT, WPARAM, LPARAM);
+
+static bool set_locale(const char *locale);
+static bool initialize_locale();
+
+// main
+int APIENTRY _tWinMain(HINSTANCE hInstance,
+                     HINSTANCE hPrevInstance,
+                     LPTSTR    lpCmdLine,
+                     int       nCmdShow)
+{
+       UNREFERENCED_PARAMETER(hPrevInstance);
+       UNREFERENCED_PARAMETER(lpCmdLine);
+
+       MSG msg;
+       HACCEL hAccelTable;
+
+       // initialize global string
+       LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
+       LoadString(hInstance, IDC_SAMPLEWINAPP, szWindowClass, MAX_LOADSTRING);
+       MyRegisterClass(hInstance);
+
+       // setting locale
+       lang_ok = initialize_locale();
+
+       // create window
+       if (!InitInstance (hInstance, nCmdShow))
+       {
+               return 0;
+       }
+
+       hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_SAMPLEWINAPP));
+
+       // message loop
+       while (GetMessage(&msg, NULL, 0, 0))
+       {
+               if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
+               {
+                       TranslateMessage(&msg);
+                       DispatchMessage(&msg);
+               }
+       }
+
+       // free all resources in libintl library
+       libintl_tfreeres();
+
+#ifdef _DEBUG
+       _CrtDumpMemoryLeaks();
+#endif
+
+       return (int) msg.wParam;
+}
+
+
+//  Regist window class for my app
+ATOM MyRegisterClass(HINSTANCE hInstance)
+{
+       WNDCLASSEX wcex;
+
+       wcex.cbSize = sizeof(WNDCLASSEX);
+
+       wcex.style                      = CS_HREDRAW | CS_VREDRAW;
+       wcex.lpfnWndProc        = WndProc;
+       wcex.cbClsExtra         = 0;
+       wcex.cbWndExtra         = 0;
+       wcex.hInstance          = hInstance;
+       wcex.hIcon                      = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SAMPLEWINAPP));
+       wcex.hCursor            = LoadCursor(NULL, IDC_ARROW);
+       wcex.hbrBackground      = (HBRUSH)(COLOR_WINDOW+1);
+       wcex.lpszMenuName       = MAKEINTRESOURCE(IDC_SAMPLEWINAPP);
+       wcex.lpszClassName      = szWindowClass;
+       wcex.hIconSm            = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SAMPLEWINAPP));
+
+       return RegisterClassEx(&wcex);
+}
+
+//  Create window
+BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
+{
+   HWND hWnd;
+
+   hInst = hInstance;
+
+   hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
+      CW_USEDEFAULT, 0, 640, 200, NULL, NULL, hInstance, NULL);
+
+   if (!hWnd)
+   {
+      return FALSE;
+   }
+
+   ShowWindow(hWnd, nCmdShow);
+   UpdateWindow(hWnd);
+
+   return TRUE;
+}
+
+
+/// set logical font
+static void set_font(HWND hWnd, const _TCHAR *font_name, double point, LPLOGFONT plf)
+{
+       HDC hdc = GetDC(hWnd);
+
+       int logdpiy = GetDeviceCaps(hdc, LOGPIXELSY);
+       LONG nHeight = (LONG)(point * (double)logdpiy / 72);
+
+       memset(plf, 0, sizeof(LOGFONT));
+    plf->lfHeight = nHeight;
+    plf->lfWidth = 0;
+    plf->lfEscapement = 0;
+    plf->lfOrientation = plf->lfEscapement;
+    plf->lfWeight = FW_DONTCARE;
+    plf->lfItalic = 0;
+    plf-> lfUnderline = 0;
+    plf->lfStrikeOut = 0;
+    plf->lfCharSet = DEFAULT_CHARSET;
+    plf->lfOutPrecision = OUT_DEFAULT_PRECIS;
+    plf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
+    plf->lfQuality = DEFAULT_QUALITY;
+    plf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
+       // フォント名
+       _tcscpy(plf->lfFaceName, font_name);
+
+       ReleaseDC(hWnd, hdc);
+}
+
+// translate messages on sub menu
+// this function is recursive.
+static void translate_submenu(HMENU hMenu)
+{
+       _TCHAR buf[_MAX_PATH];
+       MENUITEMINFO mii;
+
+       int nums = GetMenuItemCount(hMenu);
+       for(int i=0; i<nums; i++) {
+               memset(&mii, 0, sizeof(mii));
+               mii.cbSize = sizeof(mii);
+               mii.fMask = MIIM_SUBMENU | MIIM_STRING;
+               mii.dwTypeData = buf;
+               mii.cch = _MAX_PATH - 1;
+               GetMenuItemInfo(hMenu, i, TRUE, &mii);
+               if (mii.cch > 0) {
+                       mii.fMask = MIIM_STRING;
+                       const _TCHAR *p = _tgettext(mii.dwTypeData);
+                       if (p != buf) {
+                               memset(buf, 0, sizeof(buf));
+                               _tcsncpy(buf, p, _MAX_PATH-1);
+                       }
+                       mii.dwTypeData = buf;
+                       mii.cch = (UINT)_tcslen(buf);
+                       SetMenuItemInfo(hMenu, i, TRUE, &mii);
+               }
+               if (mii.hSubMenu != NULL) {
+                       translate_submenu(mii.hSubMenu);
+               }
+       }
+}
+
+// translate all messages on menu
+static void translate_menu(HWND hWnd, HMENU hMenu)
+{
+       translate_submenu(hMenu);
+}
+
+// create window
+static int create_window(HWND hWnd)
+{
+       // translate menu messages
+       translate_menu(hWnd, GetMenu(hWnd));
+
+       // create child controls
+       _TCHAR msg[_MAX_PATH];
+
+       _tcscpy(font_name, _T("MS UI Gothic"));
+       font_size = 12.0;       
+
+       // set logical font
+       LOGFONT lf;
+       set_font(hWnd, font_name, font_size, &lf);
+       HFONT hNewFont = CreateFontIndirect(&lf);
+       if (hNewFont != NULL) hFont = hNewFont;
+
+       RECT re;
+
+       DWORD dwStyle = 0;
+       int w = lf.lfHeight;
+
+       memset(hCtrls, 0, sizeof(hCtrls));
+
+       // edit box
+       re.left = 4;
+       re.right = w * 30 + re.left;
+       re.top = 4;
+       re.bottom = lf.lfHeight + re.top + 4;
+       dwStyle = ES_AUTOHSCROLL | ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER;
+       hCtrls[iCtrlsCnt] = CreateWindow(_T("EDIT"), _T("")
+       , dwStyle
+       ,re.left ,re.top, re.right-re.left, re.bottom-re.top, hWnd, NULL, hInst, NULL);
+       if (hCtrls[iCtrlsCnt]) {
+               // set text
+               _stprintf(msg, _("This program is running as process number %d."), _getpid());
+               SetWindowText(hCtrls[iCtrlsCnt], msg);
+       }
+       iCtrlsCnt++;
+
+       // font name
+       re.left = 4;
+       re.right = w * 5 + re.left;
+       re.top = re.bottom + 4;
+       re.bottom = lf.lfHeight + re.top + 4;
+       dwStyle = SS_CENTER | WS_CHILD | WS_VISIBLE;
+       hCtrls[iCtrlsCnt] = CreateWindow(_T("STATIC"), _T("font name")
+       , dwStyle
+       ,re.left ,re.top, re.right-re.left, re.bottom-re.top, hWnd, NULL, hInst, NULL);
+       iCtrlsCnt++;
+
+       re.left = re.right + 4;
+       re.right = w * 10 + re.left;
+       dwStyle = ES_AUTOHSCROLL | ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER;
+       hCtrls[iCtrlsCnt] = CreateWindow(_T("EDIT"), font_name
+       , dwStyle
+       ,re.left ,re.top, re.right-re.left, re.bottom-re.top, hWnd, NULL, hInst, NULL);
+       iCtrlFontName = iCtrlsCnt;
+       iCtrlsCnt++;
+
+       // font size
+       re.left = re.right + 4;
+       re.right = w * 5 + re.left;
+       dwStyle = SS_CENTER | WS_CHILD | WS_VISIBLE;
+       hCtrls[iCtrlsCnt] = CreateWindow(_T("STATIC"), _T("font size")
+       , dwStyle
+       ,re.left ,re.top, re.right-re.left, re.bottom-re.top, hWnd, NULL, hInst, NULL);
+       iCtrlsCnt++;
+
+       re.left = re.right + 4;
+       re.right = w * 5 + re.left;
+       dwStyle = ES_AUTOHSCROLL | ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER;
+       hCtrls[iCtrlsCnt] = CreateWindow(_T("EDIT"), _T("")
+       , dwStyle
+       ,re.left ,re.top, re.right-re.left, re.bottom-re.top, hWnd, NULL, hInst, NULL);
+       iCtrlFontSize = iCtrlsCnt;
+       if (hCtrls[iCtrlsCnt]) {
+               // set text
+               _stprintf(msg, _("%.1f"), font_size);
+               SetWindowText(hCtrls[iCtrlsCnt], msg);
+       }
+       iCtrlsCnt++;
+
+       // language
+       re.left = 4;
+       re.right = w * 5 + re.left;
+       re.top = re.bottom + 4;
+       re.bottom = lf.lfHeight + re.top + 4;
+       dwStyle = SS_CENTER | WS_CHILD | WS_VISIBLE;
+       hCtrls[iCtrlsCnt] = CreateWindow(_T("STATIC"), _T("language")
+       , dwStyle
+       ,re.left ,re.top, re.right-re.left, re.bottom-re.top, hWnd, NULL, hInst, NULL);
+       iCtrlsCnt++;
+
+       re.left = re.right + 4;
+       re.right = w * 15 + re.left;
+       dwStyle = ES_AUTOHSCROLL | ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER;
+       hCtrls[iCtrlsCnt] = CreateWindow(_T("EDIT"), _T("")
+       , dwStyle
+       ,re.left ,re.top, re.right-re.left, re.bottom-re.top, hWnd, NULL, hInst, NULL);
+       iCtrlLang = iCtrlsCnt;
+       if (hCtrls[iCtrlsCnt]) {
+               // set text
+               SetWindowTextA(hCtrls[iCtrlsCnt], lang_name);
+       }
+       iCtrlsCnt++;
+
+       re.left = re.right + 4;
+       re.right = w * 3 + re.left;
+       dwStyle = SS_CENTER | WS_CHILD | WS_VISIBLE;
+       hCtrls[iCtrlsCnt] = CreateWindow(_T("STATIC"), lang_ok ? _T("OK") : _T("NG") 
+       , dwStyle
+       ,re.left ,re.top, re.right-re.left, re.bottom-re.top, hWnd, NULL, hInst, NULL);
+       iCtrlsCnt++;
+
+       // button
+       re.left = re.right + 4;
+       re.right = w * 5 + re.left;
+       dwStyle = BS_DEFPUSHBUTTON | BS_TEXT | BS_CENTER | WS_CHILD | WS_VISIBLE;
+       hCtrls[iCtrlsCnt] = CreateWindow(_T("BUTTON"), _T("change")
+       , dwStyle
+       ,re.left ,re.top, re.right-re.left, re.bottom-re.top, hWnd, NULL, hInst, NULL);
+       iCtrlBtnChange = iCtrlsCnt;
+       iCtrlsCnt++;
+
+       hCtrls[iCtrlsCnt] = NULL;
+
+       for(int i=0; i<iCtrlsCnt; i++) {
+               // set font
+               if (hFont != NULL) SendMessage(hCtrls[i], WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
+       }
+
+       return 0;
+}
+
+// change controls in window
+static int update_window(HWND hWnd)
+{
+       _TCHAR msg[_MAX_PATH];
+
+       // set languate
+       char new_locale[_MAX_PATH];
+       GetWindowTextA(hCtrls[iCtrlLang], new_locale, _MAX_PATH-1);
+       lang_ok = set_locale(new_locale);
+
+       //
+       // Menu messages on window are already translated. So you need reattach original messages and translate them again.
+       //
+       // load menu from resource
+       HMENU hNewMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDC_SAMPLEWINAPP));
+       // destroy current menu on window
+       DestroyMenu(GetMenu(hWnd));
+       // reattach menu to window
+       SetMenu(hWnd, hNewMenu);
+       // translate menu messages
+       translate_menu(hWnd, GetMenu(hWnd));
+
+       // get font name and size from window
+       GetWindowText(hCtrls[iCtrlFontName], font_name, _MAX_PATH-1);
+       GetWindowText(hCtrls[iCtrlFontSize], msg, _MAX_PATH-1);
+       _TCHAR *endp;
+       font_size = _tcstod(msg, &endp);
+       if (font_size < 6.0) font_size = 6.0;
+       if (font_size > 48.0) font_size = 48.0;
+
+       // set logical font
+       LOGFONT lf;
+       set_font(hWnd, font_name, font_size, &lf);
+       HFONT hFont = CreateFontIndirect(&lf);
+
+       RECT re;
+
+       int cnt = 0;
+       int w = lf.lfHeight;
+
+       // edit box
+       re.left = 4;
+       re.right = w * 30 + re.left;
+       re.top = 4;
+       re.bottom = lf.lfHeight + re.top + 4;
+       if (hCtrls[cnt]) {
+               SetWindowPos(hCtrls[cnt], NULL, re.left, re.top, re.right - re.left, re.bottom - re.top, 0);
+
+               // set text
+               _stprintf(msg, _("This program is running as process number %d."), _getpid());
+               SetWindowText(hCtrls[cnt], msg);
+       }
+       cnt++;
+
+       // font name
+       re.left = 4;
+       re.right = w * 5 + re.left;
+       re.top = re.bottom + 4;
+       re.bottom = lf.lfHeight + re.top + 4;
+       if (hCtrls[cnt]) {
+               SetWindowPos(hCtrls[cnt], NULL, re.left, re.top, re.right - re.left, re.bottom - re.top, 0);
+       }
+       cnt++;
+
+       re.left = re.right + 4;
+       re.right = w * 10 + re.left;
+       if (hCtrls[cnt]) {
+               SetWindowPos(hCtrls[cnt], NULL, re.left, re.top, re.right - re.left, re.bottom - re.top, 0);
+
+               // set text
+               SetWindowText(hCtrls[iCtrlsCnt], font_name);
+       }
+       cnt++;
+
+       // font size
+       re.left = re.right + 4;
+       re.right = w * 5 + re.left;
+       if (hCtrls[cnt]) {
+               SetWindowPos(hCtrls[cnt], NULL, re.left, re.top, re.right - re.left, re.bottom - re.top, 0);
+       }
+       cnt++;
+
+       re.left = re.right + 4;
+       re.right = w * 5 + re.left;
+       if (hCtrls[cnt]) {
+               SetWindowPos(hCtrls[cnt], NULL, re.left, re.top, re.right - re.left, re.bottom - re.top, 0);
+
+               // set text
+               _TCHAR msg[100];
+               _stprintf(msg, _("%.1f"), font_size);
+
+               SetWindowText(hCtrls[iCtrlsCnt], msg);
+       }
+       cnt++;
+
+       // lang
+       re.left = 4;
+       re.right = w * 5 + re.left;
+       re.top = re.bottom + 4;
+       re.bottom = lf.lfHeight + re.top + 4;
+       if (hCtrls[cnt]) {
+               SetWindowPos(hCtrls[cnt], NULL, re.left, re.top, re.right - re.left, re.bottom - re.top, 0);
+       }
+       cnt++;
+
+       re.left = re.right + 4;
+       re.right = w * 15 + re.left;
+       if (hCtrls[cnt]) {
+               SetWindowPos(hCtrls[cnt], NULL, re.left, re.top, re.right - re.left, re.bottom - re.top, 0);
+
+               // set text
+               SetWindowTextA(hCtrls[cnt], lang_name);
+       }
+       cnt++;
+
+       re.left = re.right + 4;
+       re.right = w * 3 + re.left;
+       if (hCtrls[cnt]) {
+               SetWindowPos(hCtrls[cnt], NULL, re.left, re.top, re.right - re.left, re.bottom - re.top, 0);
+
+               SetWindowText(hCtrls[cnt], lang_ok ? _T("OK") : _T("NG"));
+       }
+       cnt++;
+
+       // button
+       re.left = re.right + 4;
+       re.right = w * 5 + re.left;
+       if (hCtrls[cnt]) {
+               SetWindowPos(hCtrls[cnt], NULL, re.left, re.top, re.right - re.left, re.bottom - re.top, 0);
+       }
+       cnt++;
+
+       for(int i=0; i<iCtrlsCnt; i++) {
+               // set font
+               if (hFont != NULL) SendMessage(hCtrls[i], WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
+       }
+
+       return 0;
+}
+
+//  Process messages
+LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+       int wmId, wmEvent;
+       PAINTSTRUCT ps;
+       HDC hdc;
+
+       switch (message)
+       {
+       case WM_COMMAND:
+               wmId    = LOWORD(wParam);
+               wmEvent = HIWORD(wParam);
+               // selected menu item
+               switch (wmId)
+               {
+               case IDM_ABOUT:
+                       DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
+                       break;
+               case IDM_EXIT:
+                       DestroyWindow(hWnd);
+                       break;
+               default:
+                       if ((HWND)lParam == hCtrls[iCtrlBtnChange]) {
+                               // change button
+                               update_window(hWnd);
+                       } else {
+                               return DefWindowProc(hWnd, message, wParam, lParam);
+                       }
+               }
+               break;
+       case WM_CREATE:
+               create_window(hWnd);
+               break;
+       case WM_PAINT:
+               hdc = BeginPaint(hWnd, &ps);
+               EndPaint(hWnd, &ps);
+               break;
+       case WM_DESTROY:
+               PostQuitMessage(0);
+               break;
+       default:
+               return DefWindowProc(hWnd, message, wParam, lParam);
+       }
+       return 0;
+}
+
+// translate messages on about box
+static BOOL CALLBACK enum_about_box_proc(HWND hWnd, LPARAM lParam)
+{
+       _TCHAR class_name[_MAX_PATH];
+       GetClassName(hWnd, class_name, _MAX_PATH-1);
+       if (_tcscmp(class_name, _T("Static")) == 0) {
+               // translate text on static control
+               _TCHAR str[_MAX_PATH];
+               memset(str, 0, sizeof(str));
+               GetWindowText(hWnd, str, _MAX_PATH-1);
+               SetWindowText(hWnd, _tgettext(str));
+       }
+       return TRUE;
+}
+
+// create about box
+static INT_PTR create_about_box(HWND hDlg)
+{
+       _TCHAR str[_MAX_PATH];
+       memset(str, 0, sizeof(str));
+
+       // translate title bar
+       GetWindowText(hDlg, str, _MAX_PATH-1);
+       SetWindowText(hDlg, _tgettext(str));
+
+       // translate messages on child controls
+       EnumChildWindows(hDlg, enum_about_box_proc, NULL);
+
+       return (INT_PTR)TRUE;
+}
+
+// about dialog box
+INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
+{
+       UNREFERENCED_PARAMETER(lParam);
+       switch (message)
+       {
+       case WM_INITDIALOG:
+               return create_about_box(hDlg);
+
+       case WM_COMMAND:
+               if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
+               {
+                       EndDialog(hDlg, LOWORD(wParam));
+                       return (INT_PTR)TRUE;
+               }
+               break;
+       }
+       return (INT_PTR)FALSE;
+}
+
+// set locale
+static bool set_locale(const char *locale)
+{
+       memset(lang_name, 0, sizeof(lang_name));
+
+       const char *new_locale = setlocale(LC_ALL, locale);
+       if (new_locale == NULL) {
+               return false;
+       }
+       LCID lcid = get_lcid(new_locale);
+       if (SetThreadLocale(lcid) != TRUE) {
+               return false;
+       }
+
+       strncpy(lang_name, new_locale, _MAX_PATH-1);
+
+       return true;
+}
+
+// initialize locale
+static bool initialize_locale()
+{
+       if (!set_locale("")) {
+               return false;
+       }
+
+       TCHAR locale_dir[3000];
+       DWORD result = GetModuleFileName(GetModuleHandle(NULL), 
+                                                                       locale_dir, sizeof(locale_dir)/sizeof(TCHAR) - 1);
+
+       if (result == 0 || result > 2950) {
+               return false;
+       }
+
+       if (PathRemoveFileSpec(&locale_dir[0]) == FALSE) {
+               return false;
+       }
+       TCHAR *p = _tcsstr(locale_dir, _T("sample-"));
+       if (p != NULL) {
+               *p = 0;
+       }
+
+       const TCHAR dir[] = _T("locale");
+       if (PathAppend(&locale_dir[0], dir) == FALSE) {
+               return false;
+       }
+
+       if (_tbindtextdomain(PACKAGE_NAME, locale_dir) == NULL) {
+               return false;
+       }
+#if defined(UNICODE) || defined(_UNICODE)
+       if (wbind_textdomain_codeset(PACKAGE_NAME, _T("UTF-16LE")) == NULL) {
+               return false;
+       }
+#endif
+       if (_ttextdomain(PACKAGE_NAME) == NULL) {
+               return false;
+       }
+
+       return true;
+}
diff --git a/samples/sample-winapp/sample-winapp.h b/samples/sample-winapp/sample-winapp.h
new file mode 100644 (file)
index 0000000..cd100b9
--- /dev/null
@@ -0,0 +1,5 @@
+#pragma once
+
+#include "resource.h"
+
+#pragma warning(disable : 4996)
diff --git a/samples/sample-winapp/sample-winapp.ico b/samples/sample-winapp/sample-winapp.ico
new file mode 100644 (file)
index 0000000..d551aa3
Binary files /dev/null and b/samples/sample-winapp/sample-winapp.ico differ
diff --git a/samples/sample-winapp/sample-winapp.rc b/samples/sample-winapp/sample-winapp.rc
new file mode 100644 (file)
index 0000000..25a2cb9
Binary files /dev/null and b/samples/sample-winapp/sample-winapp.rc differ
diff --git a/samples/sample-winapp/sample-winapp.vcproj b/samples/sample-winapp/sample-winapp.vcproj
new file mode 100644 (file)
index 0000000..785478c
--- /dev/null
@@ -0,0 +1,679 @@
+<?xml version="1.0" encoding="shift_jis"?>
+<VisualStudioProject
+       ProjectType="Visual C++"
+       Version="9.00"
+       Name="sample-winapp"
+       ProjectGUID="{029F1CB9-A270-4543-8AE0-2EA213E106EB}"
+       RootNamespace="samplewinapp"
+       Keyword="Win32Proj"
+       TargetFrameworkVersion="196613"
+       >
+       <Platforms>
+               <Platform
+                       Name="Win32"
+               />
+               <Platform
+                       Name="x64"
+               />
+       </Platforms>
+       <ToolFiles>
+       </ToolFiles>
+       <Configurations>
+               <Configuration
+                       Name="Debug|Win32"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="1"
+                       CharacterSet="2"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="..\..\include\"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="4"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               LinkIncremental="2"
+                               AdditionalLibraryDirectories="..\..\lib\x86\"
+                               GenerateDebugInformation="true"
+                               SubSystem="2"
+                               TargetMachine="1"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Release|Win32"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="1"
+                       CharacterSet="2"
+                       WholeProgramOptimization="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="2"
+                               EnableIntrinsicFunctions="true"
+                               AdditionalIncludeDirectories="..\..\include\"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+                               RuntimeLibrary="2"
+                               EnableFunctionLevelLinking="true"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               LinkIncremental="1"
+                               AdditionalLibraryDirectories="..\..\lib\x86\"
+                               GenerateDebugInformation="false"
+                               SubSystem="2"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               TargetMachine="1"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Unicode_Debug|Win32"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="1"
+                       CharacterSet="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="..\..\include\"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="4"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               LinkIncremental="2"
+                               AdditionalLibraryDirectories="..\..\lib\x86\"
+                               GenerateDebugInformation="true"
+                               SubSystem="2"
+                               TargetMachine="1"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Unicode_Release|Win32"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="1"
+                       CharacterSet="1"
+                       WholeProgramOptimization="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="2"
+                               EnableIntrinsicFunctions="true"
+                               AdditionalIncludeDirectories="..\..\include\"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+                               RuntimeLibrary="2"
+                               EnableFunctionLevelLinking="true"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               LinkIncremental="1"
+                               AdditionalLibraryDirectories="..\..\lib\x86\"
+                               GenerateDebugInformation="false"
+                               SubSystem="2"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               TargetMachine="1"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Debug|x64"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="1"
+                       CharacterSet="2"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="..\..\include\"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               LinkIncremental="2"
+                               AdditionalLibraryDirectories="..\..\lib\x64\"
+                               GenerateDebugInformation="true"
+                               SubSystem="2"
+                               TargetMachine="17"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Release|x64"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="1"
+                       CharacterSet="2"
+                       WholeProgramOptimization="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="2"
+                               EnableIntrinsicFunctions="true"
+                               AdditionalIncludeDirectories="..\..\include\"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+                               RuntimeLibrary="2"
+                               EnableFunctionLevelLinking="true"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               LinkIncremental="1"
+                               AdditionalLibraryDirectories="..\..\lib\x64\"
+                               GenerateDebugInformation="false"
+                               SubSystem="2"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               TargetMachine="17"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Unicode_Debug|x64"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="1"
+                       CharacterSet="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="..\..\include\"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               LinkIncremental="2"
+                               AdditionalLibraryDirectories="..\..\lib\x64\"
+                               GenerateDebugInformation="true"
+                               SubSystem="2"
+                               TargetMachine="17"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Unicode_Release|x64"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="1"
+                       CharacterSet="1"
+                       WholeProgramOptimization="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="2"
+                               EnableIntrinsicFunctions="true"
+                               AdditionalIncludeDirectories="..\..\include\"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+                               RuntimeLibrary="2"
+                               EnableFunctionLevelLinking="true"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               LinkIncremental="1"
+                               AdditionalLibraryDirectories="..\..\lib\x64\"
+                               GenerateDebugInformation="false"
+                               SubSystem="2"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               TargetMachine="17"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+       </Configurations>
+       <References>
+       </References>
+       <Files>
+               <Filter
+                       Name="source file"
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+                       >
+                       <File
+                               RelativePath="..\get_lcid.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\sample-winapp.cpp"
+                               >
+                       </File>
+               </Filter>
+               <Filter
+                       Name="header file"
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+                       >
+                       <File
+                               RelativePath="..\get_lcid.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\gettext.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\sample-winapp.h"
+                               >
+                       </File>
+               </Filter>
+               <Filter
+                       Name="resource file"
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+                       >
+                       <File
+                               RelativePath=".\Resource.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\sample-winapp.ico"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\sample-winapp.rc"
+                               >
+                       </File>
+               </Filter>
+       </Files>
+       <Globals>
+       </Globals>
+</VisualStudioProject>
diff --git a/samples/sample-winapp/sample-winapp.vcxproj b/samples/sample-winapp/sample-winapp.vcxproj
new file mode 100644 (file)
index 0000000..6490b60
--- /dev/null
@@ -0,0 +1,334 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Unicode_Debug|Win32">
+      <Configuration>Unicode_Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Unicode_Debug|x64">
+      <Configuration>Unicode_Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Unicode_Release|Win32">
+      <Configuration>Unicode_Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Unicode_Release|x64">
+      <Configuration>Unicode_Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{E3828F92-2B43-4EBA-98DC-14B0EBA4C981}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>samplewinapp</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\include\</AdditionalIncludeDirectories>
+      <PrecompiledHeaderFile>
+      </PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>
+      </PrecompiledHeaderOutputFile>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\..\lib\x86\</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\include\</AdditionalIncludeDirectories>
+      <PrecompiledHeaderFile>
+      </PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>
+      </PrecompiledHeaderOutputFile>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\..\lib\x64\</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\include\</AdditionalIncludeDirectories>
+      <PrecompiledHeaderFile>
+      </PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>
+      </PrecompiledHeaderOutputFile>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\..\lib\x86\</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\include\</AdditionalIncludeDirectories>
+      <PrecompiledHeaderFile>
+      </PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>
+      </PrecompiledHeaderOutputFile>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>..\..\lib\x64\</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\include\</AdditionalIncludeDirectories>
+      <PrecompiledHeaderFile>
+      </PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>
+      </PrecompiledHeaderOutputFile>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\..\lib\x86\</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\include\</AdditionalIncludeDirectories>
+      <PrecompiledHeaderFile>
+      </PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>
+      </PrecompiledHeaderOutputFile>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\..\lib\x64\</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\include\</AdditionalIncludeDirectories>
+      <PrecompiledHeaderFile>
+      </PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>
+      </PrecompiledHeaderOutputFile>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\..\lib\x86\</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Unicode_Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\include\</AdditionalIncludeDirectories>
+      <PrecompiledHeaderFile>
+      </PrecompiledHeaderFile>
+      <PrecompiledHeaderOutputFile>
+      </PrecompiledHeaderOutputFile>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>..\..\lib\x64\</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <None Include="sample-winapp.ico" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\gettext.h" />
+    <ClInclude Include="..\get_lcid.h" />
+    <ClInclude Include="Resource.h" />
+    <ClInclude Include="sample-winapp.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\get_lcid.cpp" />
+    <ClCompile Include="sample-winapp.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="sample-winapp.rc" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/samples/sample-winapp/sample-winapp.vcxproj.filters b/samples/sample-winapp/sample-winapp.vcxproj.filters
new file mode 100644 (file)
index 0000000..eb0434b
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="source file">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="header file">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="resource file">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="sample-winapp.ico">
+      <Filter>resource file</Filter>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="Resource.h">
+      <Filter>header file</Filter>
+    </ClInclude>
+    <ClInclude Include="sample-winapp.h">
+      <Filter>header file</Filter>
+    </ClInclude>
+    <ClInclude Include="..\gettext.h">
+      <Filter>header file</Filter>
+    </ClInclude>
+    <ClInclude Include="..\get_lcid.h">
+      <Filter>header file</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="sample-winapp.cpp">
+      <Filter>source file</Filter>
+    </ClCompile>
+    <ClCompile Include="..\get_lcid.cpp">
+      <Filter>source file</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="sample-winapp.rc">
+      <Filter>resource file</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/samples/sample-winapp/sample-winapp_vc09.sln b/samples/sample-winapp/sample-winapp_vc09.sln
new file mode 100644 (file)
index 0000000..0988a9c
--- /dev/null
@@ -0,0 +1,38 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample-winapp", "sample-winapp.vcproj", "{029F1CB9-A270-4543-8AE0-2EA213E106EB}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Debug|x64 = Debug|x64
+               Release|Win32 = Release|Win32
+               Release|x64 = Release|x64
+               Unicode_Debug|Win32 = Unicode_Debug|Win32
+               Unicode_Debug|x64 = Unicode_Debug|x64
+               Unicode_Release|Win32 = Unicode_Release|Win32
+               Unicode_Release|x64 = Unicode_Release|x64
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {029F1CB9-A270-4543-8AE0-2EA213E106EB}.Debug|Win32.ActiveCfg = Debug|Win32
+               {029F1CB9-A270-4543-8AE0-2EA213E106EB}.Debug|Win32.Build.0 = Debug|Win32
+               {029F1CB9-A270-4543-8AE0-2EA213E106EB}.Debug|x64.ActiveCfg = Debug|x64
+               {029F1CB9-A270-4543-8AE0-2EA213E106EB}.Debug|x64.Build.0 = Debug|x64
+               {029F1CB9-A270-4543-8AE0-2EA213E106EB}.Release|Win32.ActiveCfg = Release|Win32
+               {029F1CB9-A270-4543-8AE0-2EA213E106EB}.Release|Win32.Build.0 = Release|Win32
+               {029F1CB9-A270-4543-8AE0-2EA213E106EB}.Release|x64.ActiveCfg = Release|x64
+               {029F1CB9-A270-4543-8AE0-2EA213E106EB}.Release|x64.Build.0 = Release|x64
+               {029F1CB9-A270-4543-8AE0-2EA213E106EB}.Unicode_Debug|Win32.ActiveCfg = Unicode_Debug|Win32
+               {029F1CB9-A270-4543-8AE0-2EA213E106EB}.Unicode_Debug|Win32.Build.0 = Unicode_Debug|Win32
+               {029F1CB9-A270-4543-8AE0-2EA213E106EB}.Unicode_Debug|x64.ActiveCfg = Unicode_Debug|x64
+               {029F1CB9-A270-4543-8AE0-2EA213E106EB}.Unicode_Debug|x64.Build.0 = Unicode_Debug|x64
+               {029F1CB9-A270-4543-8AE0-2EA213E106EB}.Unicode_Release|Win32.ActiveCfg = Unicode_Release|Win32
+               {029F1CB9-A270-4543-8AE0-2EA213E106EB}.Unicode_Release|Win32.Build.0 = Unicode_Release|Win32
+               {029F1CB9-A270-4543-8AE0-2EA213E106EB}.Unicode_Release|x64.ActiveCfg = Unicode_Release|x64
+               {029F1CB9-A270-4543-8AE0-2EA213E106EB}.Unicode_Release|x64.Build.0 = Unicode_Release|x64
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/samples/sample-winapp/sample-winapp_vc10.sln b/samples/sample-winapp/sample-winapp_vc10.sln
new file mode 100644 (file)
index 0000000..f13bb04
--- /dev/null
@@ -0,0 +1,38 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual C++ Express 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample-winapp", "sample-winapp.vcxproj", "{E3828F92-2B43-4EBA-98DC-14B0EBA4C981}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Debug|x64 = Debug|x64
+               Release|Win32 = Release|Win32
+               Release|x64 = Release|x64
+               Unicode_Debug|Win32 = Unicode_Debug|Win32
+               Unicode_Debug|x64 = Unicode_Debug|x64
+               Unicode_Release|Win32 = Unicode_Release|Win32
+               Unicode_Release|x64 = Unicode_Release|x64
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {E3828F92-2B43-4EBA-98DC-14B0EBA4C981}.Debug|Win32.ActiveCfg = Debug|Win32
+               {E3828F92-2B43-4EBA-98DC-14B0EBA4C981}.Debug|Win32.Build.0 = Debug|Win32
+               {E3828F92-2B43-4EBA-98DC-14B0EBA4C981}.Debug|x64.ActiveCfg = Debug|x64
+               {E3828F92-2B43-4EBA-98DC-14B0EBA4C981}.Debug|x64.Build.0 = Debug|x64
+               {E3828F92-2B43-4EBA-98DC-14B0EBA4C981}.Release|Win32.ActiveCfg = Release|Win32
+               {E3828F92-2B43-4EBA-98DC-14B0EBA4C981}.Release|Win32.Build.0 = Release|Win32
+               {E3828F92-2B43-4EBA-98DC-14B0EBA4C981}.Release|x64.ActiveCfg = Release|x64
+               {E3828F92-2B43-4EBA-98DC-14B0EBA4C981}.Release|x64.Build.0 = Release|x64
+               {E3828F92-2B43-4EBA-98DC-14B0EBA4C981}.Unicode_Debug|Win32.ActiveCfg = Unicode_Debug|Win32
+               {E3828F92-2B43-4EBA-98DC-14B0EBA4C981}.Unicode_Debug|Win32.Build.0 = Unicode_Debug|Win32
+               {E3828F92-2B43-4EBA-98DC-14B0EBA4C981}.Unicode_Debug|x64.ActiveCfg = Unicode_Debug|x64
+               {E3828F92-2B43-4EBA-98DC-14B0EBA4C981}.Unicode_Debug|x64.Build.0 = Unicode_Debug|x64
+               {E3828F92-2B43-4EBA-98DC-14B0EBA4C981}.Unicode_Release|Win32.ActiveCfg = Unicode_Release|Win32
+               {E3828F92-2B43-4EBA-98DC-14B0EBA4C981}.Unicode_Release|Win32.Build.0 = Unicode_Release|Win32
+               {E3828F92-2B43-4EBA-98DC-14B0EBA4C981}.Unicode_Release|x64.ActiveCfg = Unicode_Release|x64
+               {E3828F92-2B43-4EBA-98DC-14B0EBA4C981}.Unicode_Release|x64.Build.0 = Unicode_Release|x64
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal