]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix Cygwin build
authorPo Lu <luangruo@yahoo.com>
Thu, 27 Jun 2024 01:59:57 +0000 (09:59 +0800)
committerEshel Yaron <me@eshelyaron.com>
Sun, 30 Jun 2024 21:01:56 +0000 (23:01 +0200)
* 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

index e840e14541e4a5206be816e52f009f7d23c67539..79c3d6ee11958e4b60e8a7b35d42e1f6c8e5c0da 100644 (file)
@@ -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);