libgpg-error fails with recent Mingw32
Simon Josefsson
simon at josefsson.org
Wed Jun 27 12:44:08 CEST 2007
Hi! I noticed that libgpg-error failed to build with recent mingw32:
make[3]: Entering directory `/home/jas/gnutls4win/build/libgpg-error-1.5/src'
if /bin/sh ../libtool --tag=CC --mode=compile i586-mingw32msvc-gcc -DHAVE_CONFIG_H -I. -I../../../src/libgpg-error-1.5/src -I.. -DLOCALEDIR=\"/home/jas/gnutls4win/inst/share/locale\" -g -O2 -MT libgpg_error_la-w32-gettext.lo -MD -MP -MF ".deps/libgpg_error_la-w32-gettext.Tpo" -c -o libgpg_error_la-w32-gettext.lo `test -f 'w32-gettext.c' || echo '../../../src/libgpg-error-1.5/src/'`w32-gettext.c; \
then mv -f ".deps/libgpg_error_la-w32-gettext.Tpo" ".deps/libgpg_error_la-w32-gettext.Plo"; else rm -f ".deps/libgpg_error_la-w32-gettext.Tpo"; exit 1; fi
mkdir .libs
i586-mingw32msvc-gcc -DHAVE_CONFIG_H -I. -I../../../src/libgpg-error-1.5/src -I.. -DLOCALEDIR=\"/home/jas/gnutls4win/inst/share/locale\" -g -O2 -MT libgpg_error_la-w32-gettext.lo -MD -MP -MF .deps/libgpg_error_la-w32-gettext.Tpo -c ../../../src/libgpg-error-1.5/src/w32-gettext.c -DDLL_EXPORT -DPIC -o .libs/libgpg_error_la-w32-gettext.o
../../../src/libgpg-error-1.5/src/w32-gettext.c: In function `_nl_locale_name':
../../../src/libgpg-error-1.5/src/w32-gettext.c:851: error: duplicate case value
../../../src/libgpg-error-1.5/src/w32-gettext.c:850: error: previously used here
../../../src/libgpg-error-1.5/src/w32-gettext.c:1059: error: duplicate case value
../../../src/libgpg-error-1.5/src/w32-gettext.c:1058: error: previously used here
../../../src/libgpg-error-1.5/src/w32-gettext.c:1067: error: duplicate case value
../../../src/libgpg-error-1.5/src/w32-gettext.c:1066: error: previously used here
make[3]: *** [libgpg_error_la-w32-gettext.lo] Error 1
make[3]: Leaving directory `/home/jas/gnutls4win/build/libgpg-error-1.5/src'
The reason is that mingw32 defines some symbols:
jas at mocca:~/gnutls4win$ grep SUBLANG_BENGALI /usr/i586-mingw32msvc/include/*
/usr/i586-mingw32msvc/include/winnt.h:#define SUBLANG_BENGALI_INDIA 0x01
jas at mocca:~/gnutls4win$
And w32-gettext.c tries to do the same:
/* Mingw headers don't have latest language and sublanguage codes. */
...
# ifndef SUBLANG_BENGALI_INDIA
# define SUBLANG_BENGALI_INDIA 0x00
# endif
# ifndef SUBLANG_BENGALI_BANGLADESH
# define SUBLANG_BENGALI_BANGLADESH 0x01
# endif
I don't know if these #define's are standardized somewhere, and if so,
which of the definitions in mingw32 or libgpg-error is in error.
Meanwhile, I'm using the patch below to work around the problem.
/Simon
--- src/libgpg-error-1.5/src/w32-gettext.c.orig 2007-06-27 12:40:37.000000000 +0200
+++ src/libgpg-error-1.5/src/w32-gettext.c 2007-06-27 12:41:11.000000000 +0200
@@ -522,10 +522,10 @@
# define SUBLANG_AZERI_CYRILLIC 0x02
# endif
# ifndef SUBLANG_BENGALI_INDIA
-# define SUBLANG_BENGALI_INDIA 0x00
+# define SUBLANG_BENGALI_INDIA 0x01
# endif
# ifndef SUBLANG_BENGALI_BANGLADESH
-# define SUBLANG_BENGALI_BANGLADESH 0x01
+# define SUBLANG_BENGALI_BANGLADESH 0x00
# endif
# ifndef SUBLANG_CHINESE_MACAU
# define SUBLANG_CHINESE_MACAU 0x05
@@ -618,16 +618,16 @@
# define SUBLANG_NEPALI_INDIA 0x02
# endif
# ifndef SUBLANG_PUNJABI_INDIA
-# define SUBLANG_PUNJABI_INDIA 0x00
+# define SUBLANG_PUNJABI_INDIA 0x01
# endif
# ifndef SUBLANG_PUNJABI_PAKISTAN
-# define SUBLANG_PUNJABI_PAKISTAN 0x01
+# define SUBLANG_PUNJABI_PAKISTAN 0x00
# endif
# ifndef SUBLANG_ROMANIAN_ROMANIA
-# define SUBLANG_ROMANIAN_ROMANIA 0x00
+# define SUBLANG_ROMANIAN_ROMANIA 0x01
# endif
# ifndef SUBLANG_ROMANIAN_MOLDOVA
-# define SUBLANG_ROMANIAN_MOLDOVA 0x01
+# define SUBLANG_ROMANIAN_MOLDOVA 0x00
# endif
# ifndef SUBLANG_SERBIAN_LATIN
# define SUBLANG_SERBIAN_LATIN 0x02
More information about the Gnupg-devel
mailing list