mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-05 11:45:54 +00:00
Fails to compile this reinterpret_cast with: error : cast from 'FARPROC' (aka 'long long (*)()') to 'pD3DCompile' (aka 'long (*)(const void *, unsigned long long, const char *, const _D3D_SHADER_MACRO *, ID3DInclude *, const char *, const char *, unsigned int, unsigned int, ID3D10Blob **, ID3D10Blob **)') converts to incompatible function type [-Werror,-Wcast-function-type] pD3DCompile d3dCompile = reinterpret_cast<pD3DCompile>( ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Casting the result of GetProcAddress to void* fixes this. Note that this is the same thing Dawn does. Change-Id: Ib185a4fe96c60163cb66cd9591679856ae95d7f2 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/83360 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>