[Top][All Lists]

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

emacs-27 0260d2d: Don't call 'mbrtowc' on WINDOWSNT

From: Eli Zaretskii
Subject: emacs-27 0260d2d: Don't call 'mbrtowc' on WINDOWSNT
Date: Mon, 1 Jun 2020 11:59:36 -0400 (EDT)

branch: emacs-27
commit 0260d2d2dbb2607e7310bdb518b7b6c0f58f5f98
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Don't call 'mbrtowc' on WINDOWSNT
    * src/emacs.c (using_utf8): Don't call 'mbrtowc' on WINDOWSNT
    systems, as it's not available on Windows 9X.
 src/emacs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/emacs.c b/src/emacs.c
index db3e92a..6118ad3 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -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;

reply via email to

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