bug-gnulib
[Top][All Lists]
Advanced

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

mingw bug and localename


From: jemarch
Subject: mingw bug and localename
Date: Tue, 27 May 2008 20:15:02 +0200
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.0.60 (powerpc-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Hello.

We are happily using gnulib in the GNU PDF Library
(http://www.gnupdf.org).

I just found a problem while using the localename module just after a
git update of the library.

_It is a mingw32 bug_, present in the latest mingw release, and I
already reported it, but I include the information here just in case
you get an error report about this issue.

In localename.c I found the following definition of language and
sublanguages codes:

#ifdef WIN32_NATIVE
...
#include <windows.h>
...
/* Mingw headers don't have latest language and sublanguage codes.  */
...
# ifndef SUBLANG_TIBETAN_PRC
# define SUBLANG_TIBETAN_PRC 0x01
# endif
# ifndef SUBLANG_TIBETAN_BHUTAN
# define SUBLANG_TIBETAN_BHUTAN 0x02
...
#endif 

Then these constants are used in several switch statements:

switch (sub)
  {
  case SUBLANG_TIBETAN_PRC:
    /* Most Tibetans would not like "bo_CN".  But Tibet does not yet
       have a country code of its own.  */
    return "bo";
  case SUBLANG_TIBETAN_BHUTAN: return "bo_BT";
  }

When compiling libgnupdf with mingw I got the following error from
gcc: 

i586-mingw32msvc-gcc -DHAVE_CONFIG_H -I. -I../src -g -O2 -MT localename.lo -MD 
-MP -MF .deps/localename.Tpo -c localename.c  -DDLL_EXPORT -DPIC -o 
.libs/localename.o
localename.c: In function 'gl_locale_name_from_win32_LANGID':
localename.c:1496: error: duplicate case value
localename.c:1492: error: previously used here

I looked into the mingw-runtime header files and I found the following
in winnt.h:

#define SUBLANG_TIBETAN_PRC     0x01
#define SUBLANG_TIBETAN_BHUTAN  0x01

So the fail is explained: both sublanguage codes has the same
value.

--
Jose E. Marchesi  <address@hidden>
                  <address@hidden>

GNU Spain         http://es.gnu.org
GNU Project       http://www.gnu.org







reply via email to

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