|
7 | 7 | #include <wingdi.h> |
8 | 8 | #include <winreg.h> |
9 | 9 | #include "win32.h" |
| 10 | +#include "win32/lazyload.h" |
10 | 11 |
|
11 | 12 | static int fd_is_interactive[3] = { 0, 0, 0 }; |
12 | 13 | #define FD_CONSOLE 0x1 |
@@ -41,26 +42,21 @@ typedef struct _CONSOLE_FONT_INFOEX { |
41 | 42 | #endif |
42 | 43 | #endif |
43 | 44 |
|
44 | | -typedef BOOL (WINAPI *PGETCURRENTCONSOLEFONTEX)(HANDLE, BOOL, |
45 | | - PCONSOLE_FONT_INFOEX); |
46 | | - |
47 | 45 | static void warn_if_raster_font(void) |
48 | 46 | { |
49 | 47 | DWORD fontFamily = 0; |
50 | | - PGETCURRENTCONSOLEFONTEX pGetCurrentConsoleFontEx; |
| 48 | + DECLARE_PROC_ADDR(kernel32.dll, BOOL, GetCurrentConsoleFontEx, |
| 49 | + HANDLE, BOOL, PCONSOLE_FONT_INFOEX); |
51 | 50 |
|
52 | 51 | /* don't bother if output was ascii only */ |
53 | 52 | if (!non_ascii_used) |
54 | 53 | return; |
55 | 54 |
|
56 | 55 | /* GetCurrentConsoleFontEx is available since Vista */ |
57 | | - pGetCurrentConsoleFontEx = (PGETCURRENTCONSOLEFONTEX) GetProcAddress( |
58 | | - GetModuleHandle("kernel32.dll"), |
59 | | - "GetCurrentConsoleFontEx"); |
60 | | - if (pGetCurrentConsoleFontEx) { |
| 56 | + if (INIT_PROC_ADDR(GetCurrentConsoleFontEx)) { |
61 | 57 | CONSOLE_FONT_INFOEX cfi; |
62 | 58 | cfi.cbSize = sizeof(cfi); |
63 | | - if (pGetCurrentConsoleFontEx(console, 0, &cfi)) |
| 59 | + if (GetCurrentConsoleFontEx(console, 0, &cfi)) |
64 | 60 | fontFamily = cfi.FontFamily; |
65 | 61 | } else { |
66 | 62 | /* pre-Vista: check default console font in registry */ |
|
0 commit comments