win: Fix -Wmicrosoft-cast warning

Standard C++ doesn't allow implicit conversion between function
pointers and void*. MSVC does allow that, so clang-cl also allows it
but emits a -Wmicrosoft-cast warning. We want to enable this warning to
make the compiler behave more similar on different platforms, so add an
explicit cast to void*. (GetProcAddress() returns FARPROC, a function
pointer type.)

Upstreamed from:
https://chromium-review.googlesource.com/c/chromium/src/+/953743

Change-Id: I3ed4e23395e1e01b31b7cf945ddb6f93e4e69d45
Reviewed-on: https://chromium-review.googlesource.com/959545
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Joshua Peraza 2018-03-12 14:06:36 -07:00 committed by Commit Bot
parent 07da37aec7
commit c27a1aaea0

View File

@ -43,7 +43,7 @@ class ScopedModuleHandle {
using ModuleHandle = HMODULE;
static void* LookUpSymbol(ModuleHandle handle, const char* symbol_name) {
return GetProcAddress(handle, symbol_name);
return reinterpret_cast<void*>(GetProcAddress(handle, symbol_name));
}
#endif