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  <[EMAIL PROTECTED]>
                  <[EMAIL PROTECTED]>

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





Reply via email to