As Rick Rankin recently pointed out, the non-MULE Windows build has been
broken for a while. I noticed this last night and here's my fix which is
somewhat different than his. I just moved the definition of
mswindows_current_locale out of the #ifdef MULE rather than calling
GetSystemDefaultLCID directly.
Mike
src/ChangeLog addition:
2005-09-08 Mike Alexander <mta(a)arbortext.com>
* intl-win32.c: Move mswindows_current_locale out of #ifdef MULE
since it's now called in non-MULE builds.
xemacs source patch:
Diff command: C:/PROGRA~1/GNU/WinCvs~1.3/cvs -q diff -u
Files affected: src/intl-win32.c
Index: src/intl-win32.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/intl-win32.c,v
retrieving revision 1.15
diff -u -u -r1.15 intl-win32.c
--- src/intl-win32.c 2005/03/13 09:21:04 1.15
+++ src/intl-win32.c 2005/09/08 04:11:01
@@ -70,13 +70,35 @@
/* Qcode_page, Qlocale, Qcurrent, Quser_default, Qsystem_default in
general-slots.h */
+LCID current_locale;
+
+static void
+set_current_lcid (LCID lcid)
+{
+ int cp;
+
+ /* This will fail under Win9x, so we remember our own locale rather than
+ consulting GetThreadLocale. */
+ SetThreadLocale (lcid);
+ current_locale = lcid;
+ cp = mswindows_locale_to_code_page (lcid);
+#ifndef NO_EXT_MULTIBYTE_FEATURES
+ _setmbcp (cp);
+#endif
+}
+
+LCID
+mswindows_current_locale (void)
+{
+ /* Even if SetThreadLocale() failed, return the right locale anyway */
+ return current_locale;
+}
+
#ifdef MULE
static Lisp_Object Vmswindows_charset_code_page_table;
static Lisp_Object Vmswindows_charset_registry_table;
-LCID current_locale;
-
/************************************************************************/
/* Language/locale/code page conversion functions */
@@ -760,21 +782,6 @@
return atoi (codepagestr);
}
-static void
-set_current_lcid (LCID lcid)
-{
- int cp;
-
- /* This will fail under Win9x, so we remember our own locale rather than
- consulting GetThreadLocale. */
- SetThreadLocale (lcid);
- current_locale = lcid;
- cp = mswindows_locale_to_code_page (lcid);
-#ifndef NO_EXT_MULTIBYTE_FEATURES
- _setmbcp (cp);
-#endif
-}
-
DEFUN ("mswindows-set-current-locale", Fmswindows_set_current_locale,
1, 1, 0, /*
Set the current MS Windows locale.
@@ -974,13 +981,6 @@
#endif /* DEBUG_XEMACS */
-LCID
-mswindows_current_locale (void)
-{
- /* Even if SetThreadLocale() failed, return the right locale anyway */
- return current_locale;
-}
-
DEFUN ("mswindows-current-locale", Fmswindows_current_locale,
0, 0, 0, /*
Return the current MS Windows locale.
@@ -2377,9 +2377,7 @@
void
init_intl_win32 (void)
{
-#ifdef MULE
set_current_lcid (GetUserDefaultLCID ());
-#endif /* MULE */
if (initialized)
/* If not initialized, we also call this, but early -- see the
Show replies by date