MinGW: Avoid function cast warnings with GetProcAddress

This commit is contained in:
Jonathan G Rennison
2021-11-09 01:08:28 +00:00
parent 49228a5ee4
commit 2b8018f5d6
6 changed files with 26 additions and 14 deletions

View File

@@ -623,7 +623,7 @@ void LoadWin32Font(FontSize fs)
/* Try a nice little undocumented function first for getting the internal font name.
* Some documentation is found at: http://www.undocprint.org/winspool/getfontresourceinfo */
typedef BOOL(WINAPI *PFNGETFONTRESOURCEINFO)(LPCTSTR, LPDWORD, LPVOID, DWORD);
static PFNGETFONTRESOURCEINFO GetFontResourceInfo = (PFNGETFONTRESOURCEINFO)GetProcAddress(GetModuleHandle(L"Gdi32"), "GetFontResourceInfoW");
static PFNGETFONTRESOURCEINFO GetFontResourceInfo = GetProcAddressT<PFNGETFONTRESOURCEINFO>(GetModuleHandle(L"Gdi32"), "GetFontResourceInfoW");
if (GetFontResourceInfo != nullptr) {
/* Try to query an array of LOGFONTs that describe the file. */