1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00

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.
This commit is contained in:
Eli Zaretskii 2014-01-19 17:42:48 +02:00
parent 75f3311ef7
commit 21f9541125
2 changed files with 28 additions and 2 deletions

View 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.

View 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
}