back port fixing GCC warnings

This commit is contained in:
Arvid Norberg 2019-08-01 23:09:46 -07:00 committed by Arvid Norberg
parent bd0d011536
commit 03ffc04e39
2 changed files with 4 additions and 1 deletions

View File

@ -55,6 +55,9 @@ POSSIBILITY OF SUCH DAMAGE.
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#pragma GCC diagnostic ignored "-Wnoexcept-type"
#endif
#if __GNUC__ >= 8
#pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
#if __GNUC__ >= 9
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif

View File

@ -60,7 +60,7 @@ namespace libtorrent { namespace aux {
if ((proc == nullptr) && !failed_proc)
{
HMODULE const handle = get_library_handle<Library>();
if (handle) proc = (Signature)GetProcAddress(handle, name);
if (handle) proc = reinterpret_cast<Signature>(reinterpret_cast<void*>(GetProcAddress(handle, name)));
failed_proc = (proc == nullptr);
}
return proc;