aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2014-01-19 17:42:48 +0200
committerEli Zaretskii2014-01-19 17:42:48 +0200
commit21f9541125cf55fb26dcb8d2e0a7049f08faa9b5 (patch)
treef82b160b4c597b238077ac180195411659cbef29 /src
parent75f3311ef7f88d1e605b2f3b1b8108e8de9173ca (diff)
downloademacs-21f9541125cf55fb26dcb8d2e0a7049f08faa9b5.tar.gz
emacs-21f9541125cf55fb26dcb8d2e0a7049f08faa9b5.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/w32font.c20
2 files changed, 28 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2ef0336388a..f20b832ed40 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12014-01-19 Eli Zaretskii <eliz@gnu.org>
2
3 * w32font.c (w32_load_unicows_or_gdi32, get_outline_metrics_w)
4 (get_text_metrics_w, get_glyph_outline_w, get_char_width_32_w)
5 [!WINDOWSNT]: These functions are no longer compiled on Cygwin;
6 they are replaced by macros that expand into direct calls to the
7 corresponding functions from GDI32.DLL.
8 (globals_of_w32font) [WINDOWSNT]: Don't initialize g_b_* static
9 variables in the Cygwin build, they are unused.
10
12014-01-19 K. Handa <handa@gnu.org> 112014-01-19 K. Handa <handa@gnu.org>
2 12
3 * composite.c (composition_update_it): Fix previous change. 13 * 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
147 style variations if the font name is not specified. */ 147 style variations if the font name is not specified. */
148static void list_all_matching_fonts (struct font_callback_data *); 148static void list_all_matching_fonts (struct font_callback_data *);
149 149
150#ifdef WINDOWSNT
151
150static BOOL g_b_init_get_outline_metrics_w; 152static BOOL g_b_init_get_outline_metrics_w;
151static BOOL g_b_init_get_text_metrics_w; 153static BOOL g_b_init_get_text_metrics_w;
152static BOOL g_b_init_get_glyph_outline_w; 154static BOOL g_b_init_get_glyph_outline_w;
@@ -244,8 +246,8 @@ get_glyph_outline_w (HDC hdc, UINT uChar, UINT uFormat, LPGLYPHMETRICS lpgm,
244 lpvBuffer, lpmat2); 246 lpvBuffer, lpmat2);
245} 247}
246 248
247static DWORD WINAPI get_char_width_32_w (HDC hdc, UINT uFirstChar, 249static DWORD WINAPI
248 UINT uLastChar, LPINT lpBuffer) 250get_char_width_32_w (HDC hdc, UINT uFirstChar, UINT uLastChar, LPINT lpBuffer)
249{ 251{
250 static GetCharWidth32W_Proc s_pfn_Get_Char_Width_32W = NULL; 252 static GetCharWidth32W_Proc s_pfn_Get_Char_Width_32W = NULL;
251 HMODULE hm_unicows = NULL; 253 HMODULE hm_unicows = NULL;
@@ -261,6 +263,18 @@ static DWORD WINAPI get_char_width_32_w (HDC hdc, UINT uFirstChar,
261 return s_pfn_Get_Char_Width_32W (hdc, uFirstChar, uLastChar, lpBuffer); 263 return s_pfn_Get_Char_Width_32W (hdc, uFirstChar, uLastChar, lpBuffer);
262} 264}
263 265
266#else /* Cygwin */
267
268/* Cygwin doesn't support Windows 9X, and links against GDI32.DLL, so
269 it can just call these functions directly. */
270#define get_outline_metrics_w(h,d,o) GetOutlineTextMetricsW(h,d,o)
271#define get_text_metrics_w(h,t) GetTextMetricsW(h,t)
272#define get_glyph_outline_w(h,uc,f,gm,b,v,m) \
273 GetGlyphOutlineW(h,uc,f,gm,b,v,m)
274#define get_char_width_32_w(h,fc,lc,b) GetCharWidth32W(h,fc,lc,b)
275
276#endif /* Cygwin */
277
264static int 278static int
265memq_no_quit (Lisp_Object elt, Lisp_Object list) 279memq_no_quit (Lisp_Object elt, Lisp_Object list)
266{ 280{
@@ -2717,8 +2731,10 @@ versions of Windows) characters. */);
2717void 2731void
2718globals_of_w32font (void) 2732globals_of_w32font (void)
2719{ 2733{
2734#ifdef WINDOWSNT
2720 g_b_init_get_outline_metrics_w = 0; 2735 g_b_init_get_outline_metrics_w = 0;
2721 g_b_init_get_text_metrics_w = 0; 2736 g_b_init_get_text_metrics_w = 0;
2722 g_b_init_get_glyph_outline_w = 0; 2737 g_b_init_get_glyph_outline_w = 0;
2723 g_b_init_get_char_width_32_w = 0; 2738 g_b_init_get_char_width_32_w = 0;
2739#endif
2724} 2740}