[PATCH v2 2/2] winevulkan: Generate constants for 64bit flags.

Georg Lehmann dadschoorse at gmail.com
Thu Mar 11 11:26:26 CST 2021



On 11.03.21 17:20, Francois Gouget wrote:
> 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?

Yes, that's the issue.

> 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.
> 

I've informed Alexandre Julliard about the missing changes to the 
generated files yesterday and he found the same issue on gcc4.8. I've 
already send out a patch [1] that should fix the issue. Sorry for the 
trouble.

Thanks,

Georg Lehmann

[1] https://source.winehq.org/patches/data/201540



More information about the wine-devel mailing list