Hi Jose, > /* 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.
Thanks for reporting it. I don't know how long time the mingw guys will need to fix their problem, so I'm applying this: 2008-05-27 Bruno Haible <[EMAIL PROTECTED]> * lib/localename.c (SUBLANG_TIBETAN_BHUTAN): Force value 2. Needed for current mingw. Reported by Jose E. Marchesi <[EMAIL PROTECTED]>. *** lib/localename.c.orig 2008-05-28 00:55:04.000000000 +0200 --- lib/localename.c 2008-05-28 00:54:05.000000000 +0200 *************** *** 731,739 **** # ifndef SUBLANG_TIBETAN_PRC # define SUBLANG_TIBETAN_PRC 0x01 # endif ! # ifndef SUBLANG_TIBETAN_BHUTAN # define SUBLANG_TIBETAN_BHUTAN 0x02 - # endif # ifndef SUBLANG_TIGRINYA_ETHIOPIA # define SUBLANG_TIGRINYA_ETHIOPIA 0x01 # endif --- 731,738 ---- # ifndef SUBLANG_TIBETAN_PRC # define SUBLANG_TIBETAN_PRC 0x01 # endif ! # undef SUBLANG_TIBETAN_BHUTAN # define SUBLANG_TIBETAN_BHUTAN 0x02 # ifndef SUBLANG_TIGRINYA_ETHIOPIA # define SUBLANG_TIGRINYA_ETHIOPIA 0x01 # endif