From 03ffc04e39b2a50149b28b82f66a8513c11a8523 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 1 Aug 2019 23:09:46 -0700 Subject: [PATCH] back port fixing GCC warnings --- include/libtorrent/aux_/disable_warnings_push.hpp | 3 +++ include/libtorrent/aux_/win_util.hpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/libtorrent/aux_/disable_warnings_push.hpp b/include/libtorrent/aux_/disable_warnings_push.hpp index 22bbe96f0..bcac96e34 100644 --- a/include/libtorrent/aux_/disable_warnings_push.hpp +++ b/include/libtorrent/aux_/disable_warnings_push.hpp @@ -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 diff --git a/include/libtorrent/aux_/win_util.hpp b/include/libtorrent/aux_/win_util.hpp index f5c1be950..9d93a622f 100644 --- a/include/libtorrent/aux_/win_util.hpp +++ b/include/libtorrent/aux_/win_util.hpp @@ -60,7 +60,7 @@ namespace libtorrent { namespace aux { if ((proc == nullptr) && !failed_proc) { HMODULE const handle = get_library_handle(); - if (handle) proc = (Signature)GetProcAddress(handle, name); + if (handle) proc = reinterpret_cast(reinterpret_cast(GetProcAddress(handle, name))); failed_proc = (proc == nullptr); } return proc;