hendrikw | b1ac52f | 2015-10-01 18:29:34 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 7 | #include "include/core/SkTypes.h" |
Mike Klein | 8f11d4d | 2018-01-24 12:42:55 -0500 | [diff] [blame] | 8 | #if defined(SK_BUILD_FOR_WIN) |
mtklein | 1ee7651 | 2015-11-02 10:20:27 -0800 | [diff] [blame] | 9 | |
Ben Wagner | ab6eefe | 2019-05-20 11:02:49 -0400 | [diff] [blame] | 10 | #include "src/core/SkLeanWindows.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "src/ports/SkOSLibrary.h" |
hendrikw | b1ac52f | 2015-10-01 18:29:34 -0700 | [diff] [blame] | 12 | |
Mike Klein | 77482cb | 2020-07-10 10:43:59 -0500 | [diff] [blame] | 13 | void* SkLoadDynamicLibrary(const char* libraryName) { |
jvanverth | 7a897c0 | 2016-01-04 08:14:18 -0800 | [diff] [blame] | 14 | return LoadLibraryA(libraryName); |
hendrikw | b1ac52f | 2015-10-01 18:29:34 -0700 | [diff] [blame] | 15 | } |
| 16 | |
Mike Klein | 77482cb | 2020-07-10 10:43:59 -0500 | [diff] [blame] | 17 | void* SkGetProcedureAddress(void* library, const char* functionName) { |
cjacek | c721196 | 2016-01-25 07:27:36 -0800 | [diff] [blame] | 18 | return reinterpret_cast<void*>(::GetProcAddress((HMODULE)library, functionName)); |
hendrikw | b1ac52f | 2015-10-01 18:29:34 -0700 | [diff] [blame] | 19 | } |
mtklein | 1ee7651 | 2015-11-02 10:20:27 -0800 | [diff] [blame] | 20 | |
Michael Ludwig | 3021795 | 2020-12-04 12:58:35 -0500 | [diff] [blame] | 21 | bool SkFreeDynamicLibrary(void* library) { |
| 22 | return FreeLibrary((HMODULE)library); |
| 23 | } |
| 24 | |
Mike Klein | 8f11d4d | 2018-01-24 12:42:55 -0500 | [diff] [blame] | 25 | #endif//defined(SK_BUILD_FOR_WIN) |