]> code.delx.au - gnu-emacs/commitdiff
Fix Cygwin w32 build broken by last commit in w32font.c.
authorEli Zaretskii <eliz@gnu.org>
Sun, 19 Jan 2014 15:42:48 +0000 (17:42 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sun, 19 Jan 2014 15:42:48 +0000 (17:42 +0200)
 src/w32font.c (w32_load_unicows_or_gdi32, get_outline_metrics_w)
 (get_text_metrics_w, get_glyph_outline_w, get_char_width_32_w)
 [!WINDOWSNT]: These functions are no longer compiled on Cygwin;
 they are replaced by macros that expand into direct calls to the
 corresponding functions from GDI32.DLL.
 (globals_of_w32font) [WINDOWSNT]: Don't initialize g_b_* static
 variables in the Cygwin build, they are unused.

src/ChangeLog
src/w32font.c

index 2ef0336388af7ae317d1ef541f5b2cd333e9b86d..f20b832ed40047064dadfb5242d9bf0ed5b2eafa 100644 (file)
@@ -1,3 +1,13 @@
+2014-01-19  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32font.c (w32_load_unicows_or_gdi32, get_outline_metrics_w)
+       (get_text_metrics_w, get_glyph_outline_w, get_char_width_32_w)
+       [!WINDOWSNT]: These functions are no longer compiled on Cygwin;
+       they are replaced by macros that expand into direct calls to the
+       corresponding functions from GDI32.DLL.
+       (globals_of_w32font) [WINDOWSNT]: Don't initialize g_b_* static
+       variables in the Cygwin build, they are unused.
+
 2014-01-19  K. Handa  <handa@gnu.org>
 
        * composite.c (composition_update_it): Fix previous change.
index c56da9109203437344a5bb61ca92c16d77b6e6f8..5262f38663fbf097cadc77c676b3b3bebff3df79 100644 (file)
@@ -147,6 +147,8 @@ struct font_callback_data
    style variations if the font name is not specified.  */
 static void list_all_matching_fonts (struct font_callback_data *);
 
+#ifdef WINDOWSNT
+
 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;
@@ -244,8 +246,8 @@ get_glyph_outline_w (HDC hdc, UINT uChar, UINT uFormat, LPGLYPHMETRICS lpgm,
                                   lpvBuffer, lpmat2);
 }
 
-static DWORD WINAPI get_char_width_32_w (HDC hdc, UINT uFirstChar,
-                                        UINT uLastChar, LPINT lpBuffer)
+static DWORD WINAPI
+get_char_width_32_w (HDC hdc, UINT uFirstChar, UINT uLastChar, LPINT lpBuffer)
 {
   static GetCharWidth32W_Proc s_pfn_Get_Char_Width_32W = NULL;
   HMODULE hm_unicows = NULL;
@@ -261,6 +263,18 @@ static DWORD WINAPI get_char_width_32_w (HDC hdc, UINT uFirstChar,
   return s_pfn_Get_Char_Width_32W (hdc, uFirstChar, uLastChar, lpBuffer);
 }
 
+#else  /* Cygwin */
+
+/* Cygwin doesn't support Windows 9X, and links against GDI32.DLL, so
+   it can just call these functions directly.  */
+#define get_outline_metrics_w(h,d,o)   GetOutlineTextMetricsW(h,d,o)
+#define get_text_metrics_w(h,t)        GetTextMetricsW(h,t)
+#define get_glyph_outline_w(h,uc,f,gm,b,v,m) \
+                                       GetGlyphOutlineW(h,uc,f,gm,b,v,m)
+#define get_char_width_32_w(h,fc,lc,b) GetCharWidth32W(h,fc,lc,b)
+
+#endif /* Cygwin */
+
 static int
 memq_no_quit (Lisp_Object elt, Lisp_Object list)
 {
@@ -2717,8 +2731,10 @@ versions of Windows) characters.  */);
 void
 globals_of_w32font (void)
 {
+#ifdef WINDOWSNT
   g_b_init_get_outline_metrics_w = 0;
   g_b_init_get_text_metrics_w = 0;
   g_b_init_get_glyph_outline_w = 0;
   g_b_init_get_char_width_32_w = 0;
+#endif
 }