From: Eli Zaretskii Date: Sun, 19 Jan 2014 15:42:48 +0000 (+0200) Subject: Fix Cygwin w32 build broken by last commit in w32font.c. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~334 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=21f9541125cf55fb26dcb8d2e0a7049f08faa9b5;p=emacs.git Fix Cygwin w32 build broken by last commit in w32font.c. 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. --- diff --git a/src/ChangeLog b/src/ChangeLog index 2ef0336388a..f20b832ed40 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2014-01-19 Eli Zaretskii + + * 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 * composite.c (composition_update_it): Fix previous change. diff --git a/src/w32font.c b/src/w32font.c index c56da910920..5262f38663f 100644 --- a/src/w32font.c +++ b/src/w32font.c @@ -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 }