From 7f5b292b12975f58ced1e445a41c4b21a350ab9b Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 17 Mar 2021 08:53:21 +1100 Subject: Remove DynamicLibrary as loading lexers with SCI_LOADLEXERLIBRARY was removed for Scintilla 5. --- win32/PlatWin.cxx | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'win32') diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 6fbd05cea..e9f451bfb 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -3410,42 +3410,6 @@ void Menu::Show(Point pt, Window &w) { Destroy(); } -class DynamicLibraryImpl : public DynamicLibrary { -protected: - HMODULE h; -public: - explicit DynamicLibraryImpl(const char *modulePath) noexcept { - h = ::LoadLibraryA(modulePath); - } - - ~DynamicLibraryImpl() override { - if (h) - ::FreeLibrary(h); - } - - // Use GetProcAddress to get a pointer to the relevant function. - Function FindFunction(const char *name) noexcept override { - if (h) { - // Use memcpy as it doesn't invoke undefined or conditionally defined behaviour. - FARPROC fp = ::GetProcAddress(h, name); - Function f = nullptr; - static_assert(sizeof(f) == sizeof(fp)); - memcpy(&f, &fp, sizeof(f)); - return f; - } else { - return nullptr; - } - } - - bool IsValid() noexcept override { - return h != NULL; - } -}; - -DynamicLibrary *DynamicLibrary::Load(const char *modulePath) { - return static_cast(new DynamicLibraryImpl(modulePath)); -} - ColourDesired Platform::Chrome() { return ColourDesired(::GetSysColor(COLOR_3DFACE)); } -- cgit v1.2.3