diff options
author | Eli Zaretskii <eliz@gnu.org> | 2014-01-18 13:46:22 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2014-01-18 13:46:22 +0200 |
commit | 5197f0c2fee01c473b4876f6a49e784250f63640 (patch) | |
tree | 31e0bf2968e74fbde5da7f1e0e13cdcd6e0c07ea /src/w32font.c | |
parent | 812a093042a860768b002b988789c53d31127bb6 (diff) | |
download | emacs-5197f0c2fee01c473b4876f6a49e784250f63640.tar.gz |
Fix file name handling on MS-Windows 9X.
src/w32.c (maybe_load_unicows_dll): New function.
src/emacs.c (main) [WINDOWSNT]: Call maybe_load_unicows_dll early
on, to make sure we can convert file names to and from UTF-8 on
Windows 9X. This fixes a failure to start up because Emacs cannot
find term/w32-win.el. Reported by oslsachem <oslsachem@gmail.com>.
src/w32font.c [WINDOWSNT]: Include w32.h.
(w32_load_unicows_or_gdi32): Call maybe_load_unicows_dll, instead
of implementing the same stuff.
Remove now unused g_b_init_is_windows_9x.
src/w32.h (maybe_load_unicows_dll): Add prototype.
nt/runemacs.c (ensure_unicows_dll): Don't tell in the message box
that "emacs -nw" can do without UNICOWS.DLL on Windows 9X. See
w32.c:maybe_load_unicows_dll and its callers for the reason.
Diffstat (limited to 'src/w32font.c')
-rw-r--r-- | src/w32font.c | 45 |
1 files changed, 4 insertions, 41 deletions
diff --git a/src/w32font.c b/src/w32font.c index a3f7ea4afe4..c56da910920 100644 --- a/src/w32font.c +++ b/src/w32font.c @@ -33,6 +33,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include "fontset.h" #include "font.h" #include "w32font.h" +#ifdef WINDOWSNT +#include "w32.h" +#endif /* Cleartype available on Windows XP, cleartype_natural from XP SP1. The latter does not try to fit cleartype smoothed fonts into the @@ -144,7 +147,6 @@ struct font_callback_data style variations if the font name is not specified. */ static void list_all_matching_fonts (struct font_callback_data *); -static BOOL g_b_init_is_w9x; static BOOL g_b_init_get_outline_metrics_w; static BOOL g_b_init_get_text_metrics_w; static BOOL g_b_init_get_glyph_outline_w; @@ -183,45 +185,7 @@ typedef BOOL (WINAPI * GetCharWidth32W_Proc) ( static HMODULE w32_load_unicows_or_gdi32 (void) { - static BOOL is_9x = 0; - OSVERSIONINFO os_ver; - HMODULE ret; - if (g_b_init_is_w9x == 0) - { - g_b_init_is_w9x = 1; - ZeroMemory (&os_ver, sizeof (OSVERSIONINFO)); - os_ver.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); - if (GetVersionEx (&os_ver)) - is_9x = (os_ver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS); - } - if (is_9x) - { - ret = LoadLibrary ("Unicows.dll"); - if (!ret) - { - int button; - - button = MessageBox (NULL, - "Emacs cannot load the UNICOWS.DLL library.\n" - "This library is essential for using Emacs\n" - "on this system. You need to install it.\n\n" - "However, you can still use Emacs by invoking\n" - "it with the '-nw' command-line option.\n\n" - "Emacs will exit when you click OK.", - "Emacs cannot load UNICOWS.DLL", - MB_ICONERROR | MB_TASKMODAL - | MB_SETFOREGROUND | MB_OK); - switch (button) - { - case IDOK: - default: - exit (1); - } - } - } - else - ret = LoadLibrary ("Gdi32.dll"); - return ret; + return maybe_load_unicows_dll (); } /* The following 3 functions call the problematic "wide" APIs via @@ -2753,7 +2717,6 @@ versions of Windows) characters. */); void globals_of_w32font (void) { - g_b_init_is_w9x = 0; g_b_init_get_outline_metrics_w = 0; g_b_init_get_text_metrics_w = 0; g_b_init_get_glyph_outline_w = 0; |