aboutsummaryrefslogtreecommitdiff
path: root/loader
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2018-03-01 09:55:46 -0500
committerLenny Komow <lenny@lunarg.com>2018-03-02 09:40:13 -0700
commit61ca7f7be14572617fc43e720a80e3ed80592014 (patch)
tree809d3bc189cefb5cf3f963a798e442fc1ac8aca1 /loader
parent49c8be631d423d16e3dd3eef4e89a09e60814b34 (diff)
downloadusermoji-61ca7f7be14572617fc43e720a80e3ed80592014.tar.xz
build: Fix -Wmicrosoft-cast warnings with clang-cl
MSVC allows implicit conversion from function pointers to void*. The C++ standard doesn't allow this, and clang-cl emits a warning when this is done. This change fixes these warnings in Vulkan-LoaderAndValidationLayers. Arguably, loader_platform_get_proc_address() should return a FARPROC so that the compiler can help checking calling conventions, but this is the simplest fix that unblocks us. This is needed for https://crbug.com/550065
Diffstat (limited to 'loader')
-rw-r--r--loader/vk_loader_platform.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h
index 505cb1e2..2b30c719 100644
--- a/loader/vk_loader_platform.h
+++ b/loader/vk_loader_platform.h
@@ -296,7 +296,7 @@ static void loader_platform_close_library(loader_platform_dl_handle library) { F
static void *loader_platform_get_proc_address(loader_platform_dl_handle library, const char *name) {
assert(library);
assert(name);
- return GetProcAddress(library, name);
+ return (void *)GetProcAddress(library, name);
}
static char *loader_platform_get_proc_address_error(const char *name) {
static char errorMsg[120];
@@ -327,7 +327,7 @@ static BOOL CALLBACK InitFuncWrapper(PINIT_ONCE InitOnce, PVOID Parameter, PVOID
static void loader_platform_thread_once_fn(void *ctl, void (*func)(void)) {
assert(func != NULL);
assert(ctl != NULL);
- InitOnceExecuteOnce((PINIT_ONCE)ctl, InitFuncWrapper, func, NULL);
+ InitOnceExecuteOnce((PINIT_ONCE)ctl, InitFuncWrapper, (void *)func, NULL);
}
#endif