https://bugs.winehq.org/show_bug.cgi?id=50559
Bug ID: 50559 Summary: widl-winrt-support patchset breaks compilation with clang Product: Wine-staging Version: 6.0 Hardware: x86-64 OS: Linux Status: NEW Severity: blocker Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: dmitry@baikal.ru CC: leslie_alistair@hotmail.com, z.figura12@gmail.com Distribution: ---
clang -c -o dlls/windows.media.speech.dll/windows.media.speech_main.cross.o dlls/windows.media.speech.dll/windows.media.speech_main.c \ -Idlls/windows.media.speech.dll -Iinclude -Iinclude/msvcrt -D__WINESRC__ -D_UCRT -DWINE_CROSS_PE \ -Wall -target i686-windows -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body \ -Wignored-qualifiers -Wno-pragma-pack -Wstrict-prototypes -Wtype-limits -Wvla -Wwrite-strings \ -Wpointer-arith -Wabsolute-value -fno-omit-frame-pointer -gdwarf-2 -gstrict-dwarf -g -O2 In file included from dlls/windows.media.speech.dll/windows.media.speech_main.c:18: include/windows.media.speechsynthesis.h:574:14: error: 'selectany' can only be applied to data items with external linkage static const DECLSPEC_SELECTANY WCHAR RuntimeClass_Windows_Media_SpeechSynthesis_VoiceInformation[] = {'W','i','n','d','o','w','s','.','M','e','d','i','a','.','S','p','e','e','c','h','S','y','n','t','h','e','s','i','s','.','V','o','i','c','e','I','n','f','o','r','m','a','t','i','o','n',0}; ^ include/winnt.h:112:39: note: expanded from macro 'DECLSPEC_SELECTANY' #define DECLSPEC_SELECTANY __declspec(selectany) ^ 1 error generated.
Source of the breakage is this patch: https://github.com/wine-staging/wine-staging/blob/master/patches/widl-winrt-...
It even mentions that: https://github.com/wine-staging/wine-staging/blob/master/patches/widl-winrt-... + /* MIDL generates extern const here */ + fprintf(header, "static const DECLSPEC_SELECTANY WCHAR RuntimeClass_%s[] = {", c_name);