bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gettext] [PATCH] Fix W64 build errors.


From: Daiki Ueno
Subject: [bug-gettext] [PATCH] Fix W64 build errors.
Date: Fri, 21 Dec 2012 17:39:02 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

I've just tried cross compile for x86_64-w64-mingw32 on Fedora and
encountered some errors similar to:
http://savannah.gnu.org/bugs/?29946

Here is a patch to fix those.

Regards,
---
 ChangeLog                           | 9 +++++++++
 autogen.sh                          | 3 +++
 gettext-runtime/intl/ChangeLog      | 7 +++++++
 gettext-runtime/intl/intl-exports.c | 9 ++++++++-
 gettext-runtime/intl/osdep.c        | 2 +-
 gettext-tools/ChangeLog             | 6 ++++++
 gettext-tools/woe32dll/export.h     | 7 +++++++
 7 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1fe3f9c..2cd8457 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-12-21  Daiki Ueno  <address@hidden>
+
+       Fix W64 build errors.
+       * autogen.sh (GNULIB_MODULES_LIBASPRINTF): Add extern-inline, for
+       the last xsize.h update.
+       (GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES): Add locale,
+       not to have copies of locale.h in both libgrep and gnulib-lib.
+       (GNULIB_MODULES_LIBGETTEXTPO): Add close.
+
 2012-12-08  Daiki Ueno  <address@hidden>
 
        * autogen.sh: Ignore libunistring tests which are known to fail.
diff --git a/autogen.sh b/autogen.sh
index 9b1b29a..ee70372 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -109,6 +109,7 @@ if ! $skip_gnulib; then
       alloca
       errno
       verify
+      extern-inline
     '
     GNULIB_MODULES_LIBASPRINTF_OTHER='
     '
@@ -221,6 +222,7 @@ if ! $skip_gnulib; then
       extensions
       gettext-h
       include_next
+      locale
       localcharset
       malloc-posix
       mbrtowc
@@ -271,6 +273,7 @@ if ! $skip_gnulib; then
     # This is a subset of the GNULIB_MODULES_FOR_SRC.
     GNULIB_MODULES_LIBGETTEXTPO='
       basename
+      close
       c-ctype
       c-strcase
       c-strstr
diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog
index daee796..5a4066b 100644
--- a/gettext-runtime/intl/ChangeLog
+++ b/gettext-runtime/intl/ChangeLog
@@ -1,3 +1,10 @@
+2012-12-21  Daiki Ueno  <address@hidden>
+
+       Fix W64 build errors.
+       * intl-exports.c (IMP) [_WIN64]: Prefix "__imp_" instead of
+       "_imp__".
+       * osdep.c: Include intl-exports.c on mingw as well as Cygwin.
+
 2012-12-10  Daiki Ueno  <address@hidden>
 
        * intl-compat.c: Fix typo in the copyright header.
diff --git a/gettext-runtime/intl/intl-exports.c 
b/gettext-runtime/intl/intl-exports.c
index 4e43b06..a18fe51 100644
--- a/gettext-runtime/intl/intl-exports.c
+++ b/gettext-runtime/intl/intl-exports.c
@@ -16,7 +16,14 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
  /* IMP(x) is a symbol that contains the address of x.  */
-#define IMP(x) _imp__##x
+#if _WIN64
+ /* mingw W64 changed the symbol prefix from W32 for MSVC
+    compatibility.  See the comments in
+    mingw-w64-headers/crt/_mingw_mac.h for more details. */
+# define IMP(x) __imp_##x
+#else
+# define IMP(x) _imp__##x
+#endif
 
  /* Ensure that the variable x is exported from the library, and that a
     pseudo-variable IMP(x) is available.  */
diff --git a/gettext-runtime/intl/osdep.c b/gettext-runtime/intl/osdep.c
index 9ca4470..7143d82 100644
--- a/gettext-runtime/intl/osdep.c
+++ b/gettext-runtime/intl/osdep.c
@@ -14,7 +14,7 @@
    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/>.  */
 
-#if defined __CYGWIN__
+#if defined __CYGWIN__ || defined __MINGW32__
 # include "intl-exports.c"
 #elif defined __EMX__
 # include "os2compat.c"
diff --git a/gettext-tools/ChangeLog b/gettext-tools/ChangeLog
index a259b3f..a71fc2e 100644
--- a/gettext-tools/ChangeLog
+++ b/gettext-tools/ChangeLog
@@ -1,3 +1,9 @@
+2012-12-21  Daiki Ueno  <address@hidden>
+
+       Fix W64 build errors.
+       * woe32dll/export.h (IMP) [_WIN64]: Prefix "__imp_" instead of
+       "_imp__".
+
 2012-12-17  Daiki Ueno  <address@hidden>
 
        * configure.ac: Use AC_CONFIG_HEADERS instead of AM_CONFIG_HEADER.
diff --git a/gettext-tools/woe32dll/export.h b/gettext-tools/woe32dll/export.h
index 23eae9a..f454ecc 100644
--- a/gettext-tools/woe32dll/export.h
+++ b/gettext-tools/woe32dll/export.h
@@ -94,7 +94,14 @@
 #if defined __GNUC__ /* GCC compiler, GNU toolchain */
 
  /* IMP(x) is a symbol that contains the address of x.  */
+#if _WIN64
+ /* mingw W64 changed the symbol prefix from W32 for MSVC
+    compatibility.  See the comments in
+    mingw-w64-headers/crt/_mingw_mac.h for more details. */
+# define IMP(x) __imp_##x
+#else
 # define IMP(x) _imp__##x
+#endif
 
  /* Ensure that the variable x is exported from the library, and that a
     pseudo-variable IMP(x) is available.  */
-- 
1.7.11.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]