On Fri Nov 17 12:49:58 2023 +0000, Martin Storsjö wrote:
I'm not sure if it's worth to move out the whole handling of `VKD3D_PRINTF_FUNC` here, instead of leaving it all where it was, and just change the `#ifdef __GNUC__` into `#if defined(__GNUC__) || defined(__clang__)` here. I guess the only case where there's a behavioural difference, is if one would have `__MINGW_PRINTF_FORMAT` defined but neither `__GNUC__` or `__clang__` defined, i.e. be compiling with actual MSVC, but with mingw headers. That's not really a real case though - so it doesn't really matter, but I was just curious if there's any other advantage, to just keeping the code as it was and just change the one ifdef?
vkd3d suffers from the same problem as Wine before PE conversion: things like DWORD need to be ints instead of longs when building for Unix targets. It actually assumes ints in debug formats, which leads to various warnings. I didn't want to extend the problem to MSVC targets.
However, I took a deeper look at Wine build system and came out with: https://gitlab.winehq.org/wine/wine/-/merge_requests/4423. It's more comprehensive: aligns Clang builds with GCC ones, avoids warnings in other imported libraries as well and fixes both mingw and msvc Clang targets.
I will change this MR as you suggested, thanks!