From 25099c744e558b682731ee97b12b73d4151c87dc Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 27 Jun 2024 09:59:57 +0800 Subject: [PATCH] Fix Cygwin build * src/w32uniscribe.c (syms_of_w32uniscribe_for_pdumper): Define and retrieve handle to USP10.DLL on Cygwin. (cherry picked from commit 8d55b38e2a1212c47bfb9f93a73fa50b9f291609) --- src/w32uniscribe.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index e840e14541e..79c3d6ee119 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c @@ -1538,12 +1538,13 @@ syms_of_w32uniscribe_for_pdumper (void) if (!initialized) return; -#ifdef WINDOWSNT /* Don't register if Uniscribe is not available. */ - HMODULE uniscribe = LoadLibrary ("usp10.dll"); + HMODULE uniscribe; if (!uniscribe) return; +#ifdef WINDOWSNT + uniscribe = LoadLibrary ("usp10.dll"); pfnScriptItemize = (void *) get_proc_addr (uniscribe, "ScriptItemize"); pfnScriptShape = (void *) get_proc_addr (uniscribe, "ScriptShape"); pfnScriptPlace = (void *) get_proc_addr (uniscribe, "ScriptPlace"); @@ -1561,15 +1562,16 @@ syms_of_w32uniscribe_for_pdumper (void) return; } #else /* Cygwin */ + uniscribe = GetModuleHandle ("usp10.dll"); pfnScriptItemize = &ScriptItemize; pfnScriptShape = &ScriptShape; pfnScriptPlace = &ScriptPlace; pfnScriptGetGlyphABCWidth = &ScriptGetGlyphABCWidth; pfnScriptFreeCache = &ScriptFreeCache; pfnScriptGetCMap = &ScriptGetCMap; -#endif /* Cygwin */ uniscribe_available = 1; +#endif /* Cygwin */ register_font_driver (&uniscribe_font_driver, NULL); -- 2.39.2