Don't call 'mbrtowc' on WINDOWSNT
authorEli Zaretskii <eliz@gnu.org>
Mon, 1 Jun 2020 15:57:39 +0000 (18:57 +0300)
committerEli Zaretskii <eliz@gnu.org>
Mon, 1 Jun 2020 15:57:39 +0000 (18:57 +0300)
* src/emacs.c (using_utf8): Don't call 'mbrtowc' on WINDOWSNT
systems, as it's not available on Windows 9X.

src/emacs.c

index db3e92a47736e069b394363acac42768a9aadebf..6118ad344542e46aff1400ae107f6943db90a467 100644 (file)
@@ -358,7 +358,10 @@ setlocale (int cat, char const *locale)
 static bool
 using_utf8 (void)
 {
-#ifdef HAVE_WCHAR_H
+  /* We don't want to compile in mbrtowc on WINDOWSNT because that
+     will prevent Emacs from starting on older Windows systems, while
+     the result is known in advance anyway...  */
+#if defined HAVE_WCHAR_H && !defined WINDOWSNT
   wchar_t wc;
   mbstate_t mbs = { 0 };
   return mbrtowc (&wc, "\xc4\x80", 2, &mbs) == 2 && wc == 0x100;