On Fri, 5 Mar 2021, Georg Lehmann wrote:
Fixes one of the issue related to the changes for VK_KHR_synchronization2.
So I guess the unspecified issue is that in C98 and older it's not possible to specify 64-bit literals in an enum? So the workaround is to declare these as 'static const' variables instead?
The trouble is that using const variables as initializers is questionable. For instance it fails with i686-w64-mingw32-gcc 6.3.0:
i686-w64-mingw32-gcc -c -o dlls/vulkan-1/tests/vulkan.cross.o ../wine/dlls/vulkan-1/tests/vulkan.c -Idlls/vulkan-1/tests \ -I../wine/dlls/vulkan-1/tests -Iinclude -I../wine/include -I../wine/include/msvcrt -D__WINESRC__ \ -D_MSVCR_VER=0 -DWINE_CROSS_PE -Wall -fno-strict-aliasing -Wdeclaration-after-statement \ -Wempty-body -Wignored-qualifiers -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits \ -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op \ -fno-omit-frame-pointer -gdwarf-2 -gstrict-dwarf -g -O2 tools/winebuild/winebuild -b i686-w64-mingw32 -w --implib -o dlls/vulkan-1/libvulkan-1.cross.a --export \ ../wine/dlls/vulkan-1/vulkan-1.spec In file included from ../wine/dlls/vulkan-1/tests/vulkan.c:21:0: ../wine/include/wine/vulkan.h:750:80: error: initializer element is not constant static const VkAccessFlagBits2KHR VK_ACCESS_2_SHADING_RATE_IMAGE_READ_BIT_NV = VK_ACCESS_2_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [...]
I'll grant you that MinGW 6.3.0 is somewhat old (20170516, Debian 9) and MinGW 8.3-win32 (from Debian 10) allows it. But do we really have to rely on this?
Currently this impacts the TestBot's build VM: https://testbot.winehq.org/JobDetails.pl?Key=86814
By the way, why was this patch committed without also refreshing include/wine/vulkan.h? I guess that's a good thing as this avoids completely breaking the TestBot. But this still does not feel right.