From efaefe9e490c1d3cf5071ab8093abb59526a5002 Mon Sep 17 00:00:00 2001 From: mitchell Date: Wed, 17 Jun 2020 19:38:48 -0400 Subject: Backport: Encapsulate GetProcAddress in a way that avoids undefined and conditionally defined behaviour. Backport of changeset 8243:09cccd3f867b. --- win32/ScintillaWin.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'win32/ScintillaWin.cxx') diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 0b7f6f77e..695371bf8 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -523,11 +523,8 @@ void ScintillaWin::Init() { hrOle = ::OleInitialize(nullptr); // Find SetCoalescableTimer which is only available from Windows 8+ - HMODULE user32 = ::GetModuleHandle(TEXT("user32.dll")); - if (user32) { - SetCoalescableTimerFn = reinterpret_cast( - ::GetProcAddress(user32, "SetCoalescableTimer")); - } + HMODULE user32 = ::GetModuleHandleW(L"user32.dll"); + SetCoalescableTimerFn = DLLFunction(user32, "SetCoalescableTimer"); vs.indicators[SC_INDICATOR_UNKNOWN] = Indicator(INDIC_HIDDEN, ColourDesired(0, 0, 0xff)); vs.indicators[SC_INDICATOR_INPUT] = Indicator(INDIC_DOTS, ColourDesired(0, 0, 0xff)); -- cgit v1.2.3