# Compilation fails on (Windows) Clang 13 due to inline ASM

**URL:** <https://forum.juce.com/t/compilation-fails-on-windows-clang-13-due-to-inline-asm/49520>\
**Category:** Development\
**Created:** [January 4, 2022, 11:03pm UTC](https://forum.juce.com/t/compilation-fails-on-windows-clang-13-due-to-inline-asm/49520 "2022-01-04T23:03:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![fruitylazarus](https://avatars.discourse-cdn.com/v4/letter/f/7feea3/32.png) [@fruitylazarus](https://forum.juce.com/u/fruitylazarus)\
**Post date:** [January 4, 2022, 11:03pm UTC](https://forum.juce.com/t/compilation-fails-on-windows-clang-13-due-to-inline-asm/49520/1 "2022-01-04T23:03:08Z")

</div>

I’m cross-compiling my audio plugin for Windows via a Linux Docker container, `mstorsjo/llvm-mingw`.

I think this has exposed me to an obscure combination (Clang on Windows). It fails to compile `juce_MathsFunctions.h` (using the macros in `juce_PlatformDefs.h`).

Because, `juce_MathsFunctions.h` has the first usage of `jassert()`, which ultimately expands the `JUCE_BREAK_IN_DEBUGGER` macro, `{ __asm int 3 }`.

We can see in Godbolt that Clang 13 [cannot compile `__asm int 3`](https://godbolt.org/z/YvjahqT4M).

Verbose build output is as follows:

```auto
[2%] Building CXX object CMakeFiles/JuicySFPlugin.dir/Source/FilePicker.cpp.obj
/opt/llvm-mingw/bin/x86_64-w64-mingw32-clang++ -DDEBUG=1 -DDONT_SET_USING_JUCE_NAMESPACE=1 -DJUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1 -DJUCE_MODULE_AVAILABLE_juce_audio_basics=1 -DJUCE_MODULE_AVAILABLE_juce_audio_devices=1 -DJUCE_MODULE_AVAILABLE_juce_audio_formats=1 -DJUCE_MODULE_AVAILABLE_juce_audio_plugin_client=1 -DJUCE_MODULE_AVAILABLE_juce_audio_processors=1 -DJUCE_MODULE_AVAILABLE_juce_audio_utils=1 -DJUCE_MODULE_AVAILABLE_juce_core=1 -DJUCE_MODULE_AVAILABLE_juce_data_structures=1 -DJUCE_MODULE_AVAILABLE_juce_events=1 -DJUCE_MODULE_AVAILABLE_juce_graphics=1 -DJUCE_MODULE_AVAILABLE_juce_gui_basics=1 -DJUCE_MODULE_AVAILABLE_juce_gui_extra=1 -DJUCE_SHARED_CODE=1 -DJUCE_STANDALONE_APPLICATION=JucePlugin_Build_Standalone -DJUCE_USE_CURL=0 -DJUCE_VST3_CAN_REPLACE_VST2=1 -DJUCE_WEB_BROWSER=0 -DJucePlugin_AAXCategory=2048 -DJucePlugin_AAXDisableBypass=0 -DJucePlugin_AAXDisableMultiMono=0 -DJucePlugin_AAXIdentifier=com.Birchlabs.JuicySFPlugin -DJucePlugin_AAXManufacturerCode=JucePlugin_ManufacturerCode -DJucePlugin_AAXProductId=JucePlugin_PluginCode -DJucePlugin_AUExportPrefix=juicysfpluginAU -DJucePlugin_AUExportPrefixQuoted=\"juicysfpluginAU\" -DJucePlugin_AUMainType="'aumu'" -DJucePlugin_AUManufacturerCode=JucePlugin_ManufacturerCode -DJucePlugin_AUSubType=JucePlugin_PluginCode -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_AU=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_Standalone=1 -DJucePlugin_Build_Unity=0 -DJucePlugin_Build_VST3=1 -DJucePlugin_Build_VST=1 -DJucePlugin_CFBundleIdentifier=com.Birchlabs.JuicySFPlugin -DJucePlugin_Desc="\"Audio plugin to play soundfonts\"" -DJucePlugin_EditorRequiresKeyboardFocus=1 -DJucePlugin_IsMidiEffect=0 -DJucePlugin_IsSynth=1 -DJucePlugin_Manufacturer=\"Birchlabs\" -DJucePlugin_ManufacturerCode=0x426c6273 -DJucePlugin_ManufacturerEmail=\"\" -DJucePlugin_ManufacturerWebsite=\"https://birchlabs.co.uk\" -DJucePlugin_Name=\"juicysfplugin\" -DJucePlugin_PluginCode=0x4a736670 -DJucePlugin_ProducesMidiOutput=0 -DJucePlugin_VSTCategory=kPlugCategSynth -DJucePlugin_VSTNumMidiInputs=16 -DJucePlugin_VSTNumMidiOutputs=16 -DJucePlugin_VSTUniqueID=JucePlugin_PluginCode -DJucePlugin_Version=3.0.0 -DJucePlugin_VersionCode=0x30000 -DJucePlugin_VersionString=\"3.0.0\" -DJucePlugin_Vst3Category="\"Instrument|Synth\"" -DJucePlugin_WantsMidiInput=1 -D_DEBUG=1 @CMakeFiles/JuicySFPlugin.dir/includes_CXX.rsp -g -fvisibility=hidden -fvisibility-inlines-hidden -Wa,-mbig-obj -pthread -mms-bitfields -g -O0 -Wall -Wshadow-all -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare -Wint-conversion -Wconditional-uninitialized -Wconstant-conversion -Wsign-conversion -Wbool-conversion -Wextra-semi -Wunreachable-code -Wcast-align -Wshift-sign-overflow -Wno-missing-field-initializers -Wnullable-to-nonnull-conversion -Wno-ignored-qualifiers -Wswitch-enum -Wpedantic -Wzero-as-null-pointer-constant -Wunused-private-field -Woverloaded-virtual -Wreorder -Winconsistent-missing-destructor-override -std=gnu++17 -MD -MT CMakeFiles/JuicySFPlugin.dir/Source/FilePicker.cpp.obj -MF CMakeFiles/JuicySFPlugin.dir/Source/FilePicker.cpp.obj.d -o CMakeFiles/JuicySFPlugin.dir/Source/FilePicker.cpp.obj -c /build/juicysfplugin/Source/FilePicker.cpp
In file included from /build/juicysfplugin/Source/FilePicker.cpp:5:
In file included from /build/juicysfplugin/Source/FilePicker.h:7:
In file included from /build/juicysfplugin/Source/../JuceLibraryCode/JuceHeader.h:14:
In file included from /linux_native/include/JUCE-6.1.4/modules/juce_audio_basics/juce_audio_basics.h:54:
In file included from /linux_native/include/JUCE-6.1.4/modules/juce_core/juce_core.h:223:
/linux_native/include/JUCE-6.1.4/modules/juce_core/maths/juce_MathsFunctions.h:129:5: error: expected 'volatile', 'inline', 'goto', or '('
    jassert (sourceRangeMax != sourceRangeMin); // mapping from a range of zero will produce NaN!
    ^
/linux_native/include/JUCE-6.1.4/modules/juce_core/system/juce_PlatformDefs.h:162:95: note: expanded from macro 'jassert'
  #define jassert(expression) JUCE_BLOCK_WITH_FORCED_SEMICOLON (if (! (expression)) jassertfalse;)
                                                                                              ^
/linux_native/include/JUCE-6.1.4/modules/juce_core/system/juce_PlatformDefs.h:152:144: note: expanded from macro 'jassertfalse'
  #define jassertfalse JUCE_BLOCK_WITH_FORCED_SEMICOLON (JUCE_LOG_CURRENT_ASSERTION; if (juce::juce_isRunningUnderDebugger()) JUCE_BREAK_IN_DEBUGGER; JUCE_ANALYZER_NORETURN)
                                                                                                                                               ^
/linux_native/include/JUCE-6.1.4/modules/juce_core/system/juce_PlatformDefs.h:85:49: note: expanded from macro 'JUCE_BREAK_IN_DEBUGGER'
  #define JUCE_BREAK_IN_DEBUGGER { __asm int 3 }

```

Full context here:

> <https://github.com/Birch-san/juicysfplugin/pull/33>
>
> Failing to compile inline assembly in Clang

I think the fix would be something like:

```auto
+ #elif JUCE_CLANG
+ // inline ASM not supported
+ #define JUCE_BREAK_IN_DEBUGGER { }
  #else
    #define JUCE_BREAK_IN_DEBUGGER { __asm int 3 }
  #endif

```

> <https://github.com/juce-framework/JUCE/blob/master/modules/juce_core/system/juce_PlatformDefs.h#L85>

---

<div class="post-metadata">

**Author:** ![fruitylazarus](https://avatars.discourse-cdn.com/v4/letter/f/7feea3/32.png) [@fruitylazarus](https://forum.juce.com/u/fruitylazarus)\
**Post date:** [January 4, 2022, 11:15pm UTC](https://forum.juce.com/t/compilation-fails-on-windows-clang-13-due-to-inline-asm/49520/2 "2022-01-04T23:15:18Z")

</div>

_working around it for now by passing cmake option: `-DCMAKE_CXX_FLAGS='-DJUCE_DISABLE_ASSERTIONS'`_

---

<div class="post-metadata">

**Author:** ![fruitylazarus](https://avatars.discourse-cdn.com/v4/letter/f/7feea3/32.png) [@fruitylazarus](https://forum.juce.com/u/fruitylazarus)\
**Post date:** [January 5, 2022, 9:20am UTC](https://forum.juce.com/t/compilation-fails-on-windows-clang-13-due-to-inline-asm/49520/3 "2022-01-05T09:20:58Z")

</div>

I’ve moved this over to a GitHub issue:

> <https://github.com/juce-framework/JUCE/issues/986>
>
> I'm cross-compiling my audio plugin for Windows via a Linux Docker container, \`m…storsjo/llvm-mingw\`.
> 
> I think this has exposed me to an obscure combination (Clang on Windows). It fails to compile \`juce\_MathsFunctions.h\` (using the macros in \`juce\_PlatformDefs.h\`).
> 
> Because, \`juce\_MathsFunctions.h\` has the first usage of \`jassert()\`, which ultimately expands the \`JUCE\_BREAK\_IN\_DEBUGGER\` macro, \`{ \_\_asm int 3 }\`.
> 
> We can see in Godbolt that Clang 13 \[cannot compile \`\_\_asm int 3\`\](https://godbolt.org/z/YvjahqT4M).
> 
> Verbose build output is as follows:
> 
> \`\`\`
> \[2%\] Building CXX object CMakeFiles/JuicySFPlugin.dir/Source/FilePicker.cpp.obj
> /opt/llvm-mingw/bin/x86\_64-w64-mingw32-clang++ -DDEBUG=1 -DDONT\_SET\_USING\_JUCE\_NAMESPACE=1 -DJUCE\_GLOBAL\_MODULE\_SETTINGS\_INCLUDED=1 -DJUCE\_MODULE\_AVAILABLE\_juce\_audio\_basics=1 -DJUCE\_MODULE\_AVAILABLE\_juce\_audio\_devices=1 -DJUCE\_MODULE\_AVAILABLE\_juce\_audio\_formats=1 -DJUCE\_MODULE\_AVAILABLE\_juce\_audio\_plugin\_client=1 -DJUCE\_MODULE\_AVAILABLE\_juce\_audio\_processors=1 -DJUCE\_MODULE\_AVAILABLE\_juce\_audio\_utils=1 -DJUCE\_MODULE\_AVAILABLE\_juce\_core=1 -DJUCE\_MODULE\_AVAILABLE\_juce\_data\_structures=1 -DJUCE\_MODULE\_AVAILABLE\_juce\_events=1 -DJUCE\_MODULE\_AVAILABLE\_juce\_graphics=1 -DJUCE\_MODULE\_AVAILABLE\_juce\_gui\_basics=1 -DJUCE\_MODULE\_AVAILABLE\_juce\_gui\_extra=1 -DJUCE\_SHARED\_CODE=1 -DJUCE\_STANDALONE\_APPLICATION=JucePlugin\_Build\_Standalone -DJUCE\_USE\_CURL=0 -DJUCE\_VST3\_CAN\_REPLACE\_VST2=1 -DJUCE\_WEB\_BROWSER=0 -DJucePlugin\_AAXCategory=2048 -DJucePlugin\_AAXDisableBypass=0 -DJucePlugin\_AAXDisableMultiMono=0 -DJucePlugin\_AAXIdentifier=com.Birchlabs.JuicySFPlugin -DJucePlugin\_AAXManufacturerCode=JucePlugin\_ManufacturerCode -DJucePlugin\_AAXProductId=JucePlugin\_PluginCode -DJucePlugin\_AUExportPrefix=juicysfpluginAU -DJucePlugin\_AUExportPrefixQuoted=\\"juicysfpluginAU\\" -DJucePlugin\_AUMainType="'aumu'" -DJucePlugin\_AUManufacturerCode=JucePlugin\_ManufacturerCode -DJucePlugin\_AUSubType=JucePlugin\_PluginCode -DJucePlugin\_Build\_AAX=0 -DJucePlugin\_Build\_AU=0 -DJucePlugin\_Build\_AUv3=0 -DJucePlugin\_Build\_Standalone=1 -DJucePlugin\_Build\_Unity=0 -DJucePlugin\_Build\_VST3=1 -DJucePlugin\_Build\_VST=1 -DJucePlugin\_CFBundleIdentifier=com.Birchlabs.JuicySFPlugin -DJucePlugin\_Desc="\\"Audio plugin to play soundfonts\\"" -DJucePlugin\_EditorRequiresKeyboardFocus=1 -DJucePlugin\_IsMidiEffect=0 -DJucePlugin\_IsSynth=1 -DJucePlugin\_Manufacturer=\\"Birchlabs\\" -DJucePlugin\_ManufacturerCode=0x426c6273 -DJucePlugin\_ManufacturerEmail=\\"\\" -DJucePlugin\_ManufacturerWebsite=\\"https://birchlabs.co.uk\\" -DJucePlugin\_Name=\\"juicysfplugin\\" -DJucePlugin\_PluginCode=0x4a736670 -DJucePlugin\_ProducesMidiOutput=0 -DJucePlugin\_VSTCategory=kPlugCategSynth -DJucePlugin\_VSTNumMidiInputs=16 -DJucePlugin\_VSTNumMidiOutputs=16 -DJucePlugin\_VSTUniqueID=JucePlugin\_PluginCode -DJucePlugin\_Version=3.0.0 -DJucePlugin\_VersionCode=0x30000 -DJucePlugin\_VersionString=\\"3.0.0\\" -DJucePlugin\_Vst3Category="\\"Instrument|Synth\\"" -DJucePlugin\_WantsMidiInput=1 -D\_DEBUG=1 @CMakeFiles/JuicySFPlugin.dir/includes\_CXX.rsp -g -fvisibility=hidden -fvisibility-inlines-hidden -Wa,-mbig-obj -pthread -mms-bitfields -g -O0 -Wall -Wshadow-all -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare -Wint-conversion -Wconditional-uninitialized -Wconstant-conversion -Wsign-conversion -Wbool-conversion -Wextra-semi -Wunreachable-code -Wcast-align -Wshift-sign-overflow -Wno-missing-field-initializers -Wnullable-to-nonnull-conversion -Wno-ignored-qualifiers -Wswitch-enum -Wpedantic -Wzero-as-null-pointer-constant -Wunused-private-field -Woverloaded-virtual -Wreorder -Winconsistent-missing-destructor-override -std=gnu++17 -MD -MT CMakeFiles/JuicySFPlugin.dir/Source/FilePicker.cpp.obj -MF CMakeFiles/JuicySFPlugin.dir/Source/FilePicker.cpp.obj.d -o CMakeFiles/JuicySFPlugin.dir/Source/FilePicker.cpp.obj -c /build/juicysfplugin/Source/FilePicker.cpp
> In file included from /build/juicysfplugin/Source/FilePicker.cpp:5:
> In file included from /build/juicysfplugin/Source/FilePicker.h:7:
> In file included from /build/juicysfplugin/Source/../JuceLibraryCode/JuceHeader.h:14:
> In file included from /linux\_native/include/JUCE-6.1.4/modules/juce\_audio\_basics/juce\_audio\_basics.h:54:
> In file included from /linux\_native/include/JUCE-6.1.4/modules/juce\_core/juce\_core.h:223:
> /linux\_native/include/JUCE-6.1.4/modules/juce\_core/maths/juce\_MathsFunctions.h:129:5: error: expected 'volatile', 'inline', 'goto', or '('
> jassert (sourceRangeMax != sourceRangeMin); // mapping from a range of zero will produce NaN!
> ^
> /linux\_native/include/JUCE-6.1.4/modules/juce\_core/system/juce\_PlatformDefs.h:162:95: note: expanded from macro 'jassert'
> #define jassert(expression) JUCE\_BLOCK\_WITH\_FORCED\_SEMICOLON (if (! (expression)) jassertfalse;)
> ^
> /linux\_native/include/JUCE-6.1.4/modules/juce\_core/system/juce\_PlatformDefs.h:152:144: note: expanded from macro 'jassertfalse'
> #define jassertfalse JUCE\_BLOCK\_WITH\_FORCED\_SEMICOLON (JUCE\_LOG\_CURRENT\_ASSERTION; if (juce::juce\_isRunningUnderDebugger()) JUCE\_BREAK\_IN\_DEBUGGER; JUCE\_ANALYZER\_NORETURN)
> ^
> /linux\_native/include/JUCE-6.1.4/modules/juce\_core/system/juce\_PlatformDefs.h:85:49: note: expanded from macro 'JUCE\_BREAK\_IN\_DEBUGGER'
> #define JUCE\_BREAK\_IN\_DEBUGGER { \_\_asm int 3 }
> 
> \`\`\`
> 
> Full context here:  
> https://github.com/Birch-san/juicysfplugin/pull/33
> 
> One (bad) workaround would be to \*\*not\*\* tell the debugger to break, if you're under clang:
> 
> https://github.com/juce-framework/JUCE/blob/master/modules/juce\_core/system/juce\_PlatformDefs.h#L85  
> \`\`\`diff
> + #elif JUCE\_CLANG
> + // inline ASM not supported
> + #define JUCE\_BREAK\_IN\_DEBUGGER { }
> #else
> #define JUCE\_BREAK\_IN\_DEBUGGER { \_\_asm int 3 }
> #endif
> \`\`\`
> 
> For now I'm working around it by passing cmake option: \`-DCMAKE\_CXX\_FLAGS='-DJUCE\_DISABLE\_ASSERTIONS'\`.

---

<div class="post-metadata">

**Author:** ![jrlanglois](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jrlanglois/32/21372_2.png) [@jrlanglois](https://forum.juce.com/u/jrlanglois)\
**Post date:** [January 5, 2022, 5:35pm UTC](https://forum.juce.com/t/compilation-fails-on-windows-clang-13-due-to-inline-asm/49520/4 "2022-01-05T17:35:31Z")

</div>

What arch are you targeting? Intel targets support `__asm int 3` just fine, so I’m guessing you’re configured for ARM (which I believe is untested with JUCE on Windows/ARM)…

A compatibility list for the debug trap for various archs and toolchains can be found here: [c++ - Is there a portable equivalent to DebugBreak()/\_\_debugbreak? - Stack Overflow](https://stackoverflow.com/a/49079078)

I don’t think leaving the debug trap blank is the right solution.

---

<div class="post-metadata">

**Author:** ![fruitylazarus](https://avatars.discourse-cdn.com/v4/letter/f/7feea3/32.png) [@fruitylazarus](https://forum.juce.com/u/fruitylazarus)\
**Post date:** [January 5, 2022, 7:58pm UTC](https://forum.juce.com/t/compilation-fails-on-windows-clang-13-due-to-inline-asm/49520/5 "2022-01-05T19:58:47Z")

</div>

The first compile failure I’m experiencing occurs on x86\_64. Here’s a [minimal repro on Godbolt](https://godbolt.org/z/YvjahqT4M).

From [the StackOverflow that you’ve linked](https://stackoverflow.com/a/49079078/5257399), it sounds like the syntax Clang is expecting is:

```auto
// https://github.com/nemequ/portable-snippets/blob/84abba93ff3d52c87e08ba81de1cc6615a42b72e/debug-trap/debug-trap.h
__asm__  __volatile__ ("int3");

```

this does indeed look like it [compiles on Clang x86\_64](https://godbolt.org/z/bK6qGnq3h).

---

<div class="post-metadata">

**Author:** ![jrlanglois](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jrlanglois/32/21372_2.png) [@jrlanglois](https://forum.juce.com/u/jrlanglois)\
**Post date:** [January 5, 2022, 8:40pm UTC](https://forum.juce.com/t/compilation-fails-on-windows-clang-13-due-to-inline-asm/49520/6 "2022-01-05T20:40:21Z")

</div>

Interesting. Then again, Godbolt + clang + x86\_64 provides the `int3` via [`__builtin_debugtrap()`](https://clang.llvm.org/docs/LanguageExtensions.html#builtin-debugtrap) (as provided by Clang). That would probably be more well-rounded from the toolchain’s POV - it should work with ARM devices.

You can see an example of this working with Clang as far as back as 3.3: [Compiler Explorer](https://godbolt.org/z/rqqh7sK9W)

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [January 18, 2022, 4:03pm UTC](https://forum.juce.com/t/compilation-fails-on-windows-clang-13-due-to-inline-asm/49520/7 "2022-01-18T16:03:19Z")

</div>

I’ve recently spent some time fixing JUCE builds for MinGW-W64 8.1.0+ (that’s the version that ships in the most recent CodeBlocks).

The relevant changes are

> <https://github.com/juce-framework/JUCE/commit/f429647ae90a010550c453006f7f1170e74d5718>

> <https://github.com/juce-framework/JUCE/commit/640194c87857978c86fcc4f3a0a5f675e323435c>
>
> With this patch applied, the DemoRunner should build under MinGW, and be
> (nearly…) feature-complete compared to the MSVC build.
> 
> Specifically, when building with MinGW:
> \- Adds support for accessibility
> \- Fixes build issues in the juce\_video module
> \- Fixes a link issue in the VST3 wrapper when VST3\_CAN\_REPLACE\_VST2 is
> defined
> \- Adds support for the new-style native FileChooser
> \- Tidies up some other low-severity warnings
> 
> Known issues:
> \- Direct2D rendering is still not supported when building with MinGW due
> to ABI compatibilities.

Please try building with JUCE from the most recent `develop` branch and let us know if you run into any further issues.

---

<div class="post-metadata">

**Author:** ![fruitylazarus](https://avatars.discourse-cdn.com/v4/letter/f/7feea3/32.png) [@fruitylazarus](https://forum.juce.com/u/fruitylazarus)\
**Post date:** [February 12, 2022, 8:00pm UTC](https://forum.juce.com/t/compilation-fails-on-windows-clang-13-due-to-inline-asm/49520/8 "2022-02-12T20:00:06Z")

</div>

Hey, I’ve tried upgrading to JUCE 6.1.5 but still getting uuidof() errors:

> <https://github.com/juce-framework/JUCE/issues/1023>
>
> \### Detailed steps on how to reproduce the bug
> 
> Use llvm-mingw toolchain to co…mpile JUCE's "audio plugin" example:
> 
> \`\`\`bash
> git clone https://github.com/Birch-san/juce-repro.git
> cd juce-repro
> docker build --tag=juce-repro .
> \`\`\`
> 
> Source code available in https://github.com/Birch-san/juce-repro.
> 
> Compilation of audio plugin will fail with:
> 
> \`\`\`
> In file included from /linux\_native/include/JUCE-6.1.5/modules/juce\_core/juce\_core.h:351:
> /linux\_native/include/JUCE-6.1.5/modules/juce\_core/native/juce\_win32\_ComSmartPtr.h:178:22: error: use of undeclared identifier '\_\_mingw\_uuidof'
> if (refId == \_\_uuidof (IUnknown))
> ^
> /opt/llvm-mingw/x86\_64-w64-mingw32/include/\_mingw.h:564:24: note: expanded from macro '\_\_uuidof'
> \#define \_\_uuidof(type) \_\_mingw\_uuidof\<\_\_typeof(type)\>()
> \`\`\`
> 
> This looks related to the \`\_\_uuidof(x)\` problem I reported previously (presumed introduced with JUCE 6.1.3):  
> https://github.com/juce-framework/JUCE/issues/985
> 
> I \*\*have\*\* \[previously succeeded\](https://github.com/Birch-san/juicysfplugin/blob/master/win32.Dockerfile) in cross-compiling (on JUCE 6.1.2 with a \[minor tweak\](https://github.com/Birch-san/JUCE/commit/7182e6e11a2dea40ae450548da7aaa0375e3f518)), so this can be thought of as a regression for llvm-mingw consumers.
> 
> \### What is the expected behaviour?
> 
> Compilation should succeed without error.
> 
> \### Operating systems
> 
> Linux
> 
> \### What versions of the operating systems?
> 
> Ubuntu 22.04 aarch64 cross-compiling for Windows 7 x86\_64
> 
> \### Architectures
> 
> x86\_64
> 
> \### Stacktrace
> 
> \`\`\`shell
> In file included from /linux\_native/include/JUCE-6.1.5/modules/juce\_core/juce\_core.h:351:
> /linux\_native/include/JUCE-6.1.5/modules/juce\_core/native/juce\_win32\_ComSmartPtr.h:178:22: error: use of undeclared identifier '\_\_mingw\_uuidof'
> if (refId == \_\_uuidof (IUnknown))
> ^
> /opt/llvm-mingw/x86\_64-w64-mingw32/include/\_mingw.h:564:24: note: expanded from macro '\_\_uuidof'
> \#define \_\_uuidof(type) \_\_mingw\_uuidof\<\_\_typeof(type)\>()
> \`\`\`
> 
> 
> \### Plug-in formats (if applicable)
> 
> Standalone
> 
> \### Plug-in host applications (DAWs) (if applicable)
> 
> \_No response\_
> 
> \### Testing on the \`develop\` branch
> 
> I have not tested against the \`develop\` branch
> 
> \### Code of Conduct
> 
> \- \[X\] I agree to follow the Code of Conduct

and now cross-compilation is even harder, since a new dependency has been introduced on the Windows SDK:

> <https://github.com/juce-framework/JUCE/issues/1024>
>
> \### Detailed steps on how to reproduce the bug
> 
> I use llvm-mingw toolchain to cr…oss-compile JUCE (on Linux, for Windows).  
> This \[worked\](https://github.com/Birch-san/juicysfplugin/blob/master/win32.Dockerfile) in JUCE 6.1.2 (with \[minor tweaks\](https://github.com/Birch-san/JUCE/commit/7182e6e11a2dea40ae450548da7aaa0375e3f518)).
> 
> I'm trying to upgrade to JUCE 6.1.5; new build steps are as follows (\[source code\](https://github.com/Birch-san/juicysfplugin/blob/update-deps/win32.arm.Dockerfile) here):
> 
> \`\`\`bash
> git clone https://github.com/Birch-san/juicysfplugin.git
> cd juicysfplugin
> git checkout update-deps
> docker build . -f win32.arm.Dockerfile --tag=llvm-mingw-arm
> \`\`\`
> 
> As of 6.1.5: JUCE attempts \`#include \<UIAutomation.h\>\` regardless of tooclhain:  
> https://github.com/juce-framework/JUCE/blob/53b04877c6ebc7ef3cb42e84cb11a48e0cf809b5/modules/juce\_gui\_basics/juce\_gui\_basics.cpp#L70
> 
> This has introduced for the first time a dependency on the Windows SDK, which has serious difficulties compiling in clang:  
> https://gist.github.com/Birch-san/d54e6e64be4e954b59a5156f76472a0a
> 
> \`\`\`
> /xwin/sdk/include/um/winnt.h:8145:47: error: invalid operands to binary expression ('LONGLONG' (aka 'double') and 'LONGLONG')
> Old | Value,
> ~~~^~~~~~
> /xwin/sdk/include/um/winnt.h:8183:14: error: no matching function for call to '\_InterlockedCompareExchange64'
> } while (InterlockedCompareExchange64(Addend,
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /xwin/sdk/include/um/winnt.h:8057:38: note: expanded from macro 'InterlockedCompareExchange64'
> \#define InterlockedCompareExchange64 \_InterlockedCompareExchange64
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /xwin/sdk/include/um/winnt.h:7763:1: note: candidate function not viable: no known conversion from 'volatile LONGLONG \*' (aka 'volatile double \*') to 'volatile LONG64 \*' (aka 'volatile long long \*') for 1st argument
> InterlockedCompareExchange64 (
> ^
> /xwin/sdk/include/um/winnt.h:7740:38: note: expanded from macro 'InterlockedCompareExchange64'
> \#define InterlockedCompareExchange64 \_InterlockedCompareExchange64
> ^
> /xwin/sdk/include/um/winnt.h:8205:14: error: no matching function for call to '\_InterlockedCompareExchange64'
> } while (InterlockedCompareExchange64(Addend,
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /xwin/sdk/include/um/winnt.h:8057:38: note: expanded from macro 'InterlockedCompareExchange64'
> \#define InterlockedCompareExchange64 \_InterlockedCompareExchange64
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /xwin/sdk/include/um/winnt.h:7763:1: note: candidate function not viable: no known conversion from 'volatile LONGLONG \*' (aka 'volatile double \*') to 'volatile LONG64 \*' (aka 'volatile long long \*') for 1st argument
> InterlockedCompareExchange64 (
> ^
> /xwin/sdk/include/um/winnt.h:7740:38: note: expanded from macro 'InterlockedCompareExchange64'
> \#define InterlockedCompareExchange64 \_InterlockedCompareExchange64
> \`\`\`
> 
> So there are at least two problems here (which prevent Clang compiling the Windows SDK):  
> \- \`long long\` is defined as a \`double\` (hence we're failing to do binary arithmetic on floats)
> \- \`\_InterlockedCompareExchange64\` compiler intrinsic is not implemented
> 
> My ideal solution would be "find a way to compile the Windows SDK headers on llvm-mingw toolchain", but failing that it'd at be good to have some way to fall back to the JUCE 6.1.2 behaviour (compile without a dependency on Windows SDK).
> 
> \### What is the expected behaviour?
> 
> Compiles juce\_gui\_basics.cpp without error.
> 
> \### Operating systems
> 
> Linux
> 
> \### What versions of the operating systems?
> 
> Ubuntu 22.04 aarch64 cross-compiling for Windows 7 x86\_64
> 
> \### Architectures
> 
> x86\_64
> 
> \### Stacktrace
> 
> \`\`\`shell
> /xwin/sdk/include/um/winnt.h:8145:47: error: invalid operands to binary expression ('LONGLONG' (aka 'double') and 'LONGLONG')
> Old | Value,
> ~~~^~~~~~
> /xwin/sdk/include/um/winnt.h:8183:14: error: no matching function for call to '\_InterlockedCompareExchange64'
> } while (InterlockedCompareExchange64(Addend,
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /xwin/sdk/include/um/winnt.h:8057:38: note: expanded from macro 'InterlockedCompareExchange64'
> \#define InterlockedCompareExchange64 \_InterlockedCompareExchange64
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /xwin/sdk/include/um/winnt.h:7763:1: note: candidate function not viable: no known conversion from 'volatile LONGLONG \*' (aka 'volatile double \*') to 'volatile LONG64 \*' (aka 'volatile long long \*') for 1st argument
> InterlockedCompareExchange64 (
> ^
> /xwin/sdk/include/um/winnt.h:7740:38: note: expanded from macro 'InterlockedCompareExchange64'
> \#define InterlockedCompareExchange64 \_InterlockedCompareExchange64
> ^
> /xwin/sdk/include/um/winnt.h:8205:14: error: no matching function for call to '\_InterlockedCompareExchange64'
> } while (InterlockedCompareExchange64(Addend,
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /xwin/sdk/include/um/winnt.h:8057:38: note: expanded from macro 'InterlockedCompareExchange64'
> \#define InterlockedCompareExchange64 \_InterlockedCompareExchange64
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /xwin/sdk/include/um/winnt.h:7763:1: note: candidate function not viable: no known conversion from 'volatile LONGLONG \*' (aka 'volatile double \*') to 'volatile LONG64 \*' (aka 'volatile long long \*') for 1st argument
> InterlockedCompareExchange64 (
> ^
> /xwin/sdk/include/um/winnt.h:7740:38: note: expanded from macro 'InterlockedCompareExchange64'
> \#define InterlockedCompareExchange64 \_InterlockedCompareExchange64
> \`\`\`
> 
> 
> \### Plug-in formats (if applicable)
> 
> Standalone
> 
> \### Plug-in host applications (DAWs) (if applicable)
> 
> \_No response\_
> 
> \### Testing on the \`develop\` branch
> 
> I have not tested against the \`develop\` branch
> 
> \### Code of Conduct
> 
> \- \[X\] I agree to follow the Code of Conduct

how do I compile the Windows SDK headers with Clang on Linux?

---

<div class="post-metadata">

**Author:** ![fruitylazarus](https://avatars.discourse-cdn.com/v4/letter/f/7feea3/32.png) [@fruitylazarus](https://forum.juce.com/u/fruitylazarus)\
**Post date:** [February 13, 2022, 11:19pm UTC](https://forum.juce.com/t/compilation-fails-on-windows-clang-13-due-to-inline-asm/49520/9 "2022-02-13T23:19:21Z")

</div>

okay, looks like MinGW **does** come with Windows SDK headers, but the filename is lowercase so it wasn’t discovered.

> <https://github.com/juce-framework/JUCE/issues/1024#issuecomment-1038470396>
>
> \### Detailed steps on how to reproduce the bug
> 
> I use llvm-mingw toolchain to cr…oss-compile JUCE (on Linux, for Windows).  
> This \[worked\](https://github.com/Birch-san/juicysfplugin/blob/master/win32.Dockerfile) in JUCE 6.1.2 (with \[minor tweaks\](https://github.com/Birch-san/JUCE/commit/7182e6e11a2dea40ae450548da7aaa0375e3f518)).
> 
> I'm trying to upgrade to JUCE 6.1.5; new build steps are as follows (\[source code\](https://github.com/Birch-san/juicysfplugin/blob/update-deps/win32.arm.Dockerfile) here):
> 
> \`\`\`bash
> git clone https://github.com/Birch-san/juicysfplugin.git
> cd juicysfplugin
> git checkout update-deps
> docker build . -f win32.arm.Dockerfile --tag=llvm-mingw-arm
> \`\`\`
> 
> As of 6.1.5: JUCE attempts \`#include \<UIAutomation.h\>\` regardless of tooclhain:  
> https://github.com/juce-framework/JUCE/blob/53b04877c6ebc7ef3cb42e84cb11a48e0cf809b5/modules/juce\_gui\_basics/juce\_gui\_basics.cpp#L70
> 
> This has introduced for the first time a dependency on the Windows SDK, which has serious difficulties compiling in clang:  
> https://gist.github.com/Birch-san/d54e6e64be4e954b59a5156f76472a0a
> 
> \`\`\`
> /xwin/sdk/include/um/winnt.h:8145:47: error: invalid operands to binary expression ('LONGLONG' (aka 'double') and 'LONGLONG')
> Old | Value,
> ~~~^~~~~~
> /xwin/sdk/include/um/winnt.h:8183:14: error: no matching function for call to '\_InterlockedCompareExchange64'
> } while (InterlockedCompareExchange64(Addend,
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /xwin/sdk/include/um/winnt.h:8057:38: note: expanded from macro 'InterlockedCompareExchange64'
> \#define InterlockedCompareExchange64 \_InterlockedCompareExchange64
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /xwin/sdk/include/um/winnt.h:7763:1: note: candidate function not viable: no known conversion from 'volatile LONGLONG \*' (aka 'volatile double \*') to 'volatile LONG64 \*' (aka 'volatile long long \*') for 1st argument
> InterlockedCompareExchange64 (
> ^
> /xwin/sdk/include/um/winnt.h:7740:38: note: expanded from macro 'InterlockedCompareExchange64'
> \#define InterlockedCompareExchange64 \_InterlockedCompareExchange64
> ^
> /xwin/sdk/include/um/winnt.h:8205:14: error: no matching function for call to '\_InterlockedCompareExchange64'
> } while (InterlockedCompareExchange64(Addend,
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /xwin/sdk/include/um/winnt.h:8057:38: note: expanded from macro 'InterlockedCompareExchange64'
> \#define InterlockedCompareExchange64 \_InterlockedCompareExchange64
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /xwin/sdk/include/um/winnt.h:7763:1: note: candidate function not viable: no known conversion from 'volatile LONGLONG \*' (aka 'volatile double \*') to 'volatile LONG64 \*' (aka 'volatile long long \*') for 1st argument
> InterlockedCompareExchange64 (
> ^
> /xwin/sdk/include/um/winnt.h:7740:38: note: expanded from macro 'InterlockedCompareExchange64'
> \#define InterlockedCompareExchange64 \_InterlockedCompareExchange64
> \`\`\`
> 
> So there are at least two problems here (which prevent Clang compiling the Windows SDK):  
> \- \`long long\` is defined as a \`double\` (hence we're failing to do binary arithmetic on floats)
> \- \`\_InterlockedCompareExchange64\` compiler intrinsic is not implemented
> 
> My ideal solution would be "find a way to compile the Windows SDK headers on llvm-mingw toolchain", but failing that it'd at be good to have some way to fall back to the JUCE 6.1.2 behaviour (compile without a dependency on Windows SDK).
> 
> \### What is the expected behaviour?
> 
> Compiles juce\_gui\_basics.cpp without error.
> 
> \### Operating systems
> 
> Linux
> 
> \### What versions of the operating systems?
> 
> Ubuntu 22.04 aarch64 cross-compiling for Windows 7 x86\_64
> 
> \### Architectures
> 
> x86\_64
> 
> \### Stacktrace
> 
> \`\`\`shell
> /xwin/sdk/include/um/winnt.h:8145:47: error: invalid operands to binary expression ('LONGLONG' (aka 'double') and 'LONGLONG')
> Old | Value,
> ~~~^~~~~~
> /xwin/sdk/include/um/winnt.h:8183:14: error: no matching function for call to '\_InterlockedCompareExchange64'
> } while (InterlockedCompareExchange64(Addend,
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /xwin/sdk/include/um/winnt.h:8057:38: note: expanded from macro 'InterlockedCompareExchange64'
> \#define InterlockedCompareExchange64 \_InterlockedCompareExchange64
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /xwin/sdk/include/um/winnt.h:7763:1: note: candidate function not viable: no known conversion from 'volatile LONGLONG \*' (aka 'volatile double \*') to 'volatile LONG64 \*' (aka 'volatile long long \*') for 1st argument
> InterlockedCompareExchange64 (
> ^
> /xwin/sdk/include/um/winnt.h:7740:38: note: expanded from macro 'InterlockedCompareExchange64'
> \#define InterlockedCompareExchange64 \_InterlockedCompareExchange64
> ^
> /xwin/sdk/include/um/winnt.h:8205:14: error: no matching function for call to '\_InterlockedCompareExchange64'
> } while (InterlockedCompareExchange64(Addend,
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /xwin/sdk/include/um/winnt.h:8057:38: note: expanded from macro 'InterlockedCompareExchange64'
> \#define InterlockedCompareExchange64 \_InterlockedCompareExchange64
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /xwin/sdk/include/um/winnt.h:7763:1: note: candidate function not viable: no known conversion from 'volatile LONGLONG \*' (aka 'volatile double \*') to 'volatile LONG64 \*' (aka 'volatile long long \*') for 1st argument
> InterlockedCompareExchange64 (
> ^
> /xwin/sdk/include/um/winnt.h:7740:38: note: expanded from macro 'InterlockedCompareExchange64'
> \#define InterlockedCompareExchange64 \_InterlockedCompareExchange64
> \`\`\`
> 
> 
> \### Plug-in formats (if applicable)
> 
> Standalone
> 
> \### Plug-in host applications (DAWs) (if applicable)
> 
> \_No response\_
> 
> \### Testing on the \`develop\` branch
> 
> I have not tested against the \`develop\` branch
> 
> \### Code of Conduct
> 
> \- \[X\] I agree to follow the Code of Conduct

I do have some new Clang 14 related compile errors, and x86 audio plugins no longer compile at all. will raise tickets for those.

---

<div class="post-metadata">

**Author:** ![fruitylazarus](https://avatars.discourse-cdn.com/v4/letter/f/7feea3/32.png) [@fruitylazarus](https://forum.juce.com/u/fruitylazarus)\
**Post date:** [February 14, 2022, 12:17am UTC](https://forum.juce.com/t/compilation-fails-on-windows-clang-13-due-to-inline-asm/49520/10 "2022-02-14T00:17:13Z")

</div>

Tickets raised:

> <https://github.com/juce-framework/JUCE/issues/1029>
>
> \### Detailed steps on how to reproduce the bug
> 
> \[Containerised repro\](https://gi…thub.com/Birch-san/juce-repro) using JUCE audio plugin example:
> 
> \`\`\`bash
> git clone https://github.com/Birch-san/juce-repro.git
> cd juce-repro
> docker build --build-arg LLVM\_MINGW\_VER=20211002 --build-arg XARCH=i686 .
> \`\`\`
> 
> \_Note: we are using \[llvm-mingw 20211002\](https://github.com/mstorsjo/llvm-mingw/releases/tag/20211002) because there is an unrelated compilation failure (https://github.com/juce-framework/JUCE/issues/1028) on \[llvm-mingw 20220209\](https://github.com/mstorsjo/llvm-mingw/releases/tag/20220209).\_
> 
> The last JUCE version on which I was able to successfully cross-compile an audio plugin for x86, was JUCE 6.1.2. See https://github.com/juce-framework/JUCE/issues/985 for the problems with compiling \`uuidof()\` that have ensued since then. The issue I'm filing today is the latest incarnation of the \`uuidof()\` problem
> 
> In x86 build \_only\_, we fail to compile \`juce\_gui\_basics.cpp\`, because of the template function \`UUIDGetter\`:
> 
> \`\`\`
> In file included from /linux\_native/include/JUCE-6.1.5/modules/juce\_gui\_basics/juce\_gui\_basics.cpp:309:
> /linux\_native/include/JUCE-6.1.5/modules/juce\_gui\_basics/native/accessibility/juce\_win32\_ComInterfaces.h:179:1: error: class template specialization of 'UUIDGetter' not in a namespace enclosing 'juce'
> JUCE\_COMCLASS (IRawElementProviderFragmentRoot, "620ce2a5-ab8f-40a9-86cb-de3c75599b58") : public IUnknown
> ^
> /linux\_native/include/JUCE-6.1.5/modules/juce\_core/native/juce\_win32\_ComSmartPtr.h:45:5: note: expanded from macro 'JUCE\_COMCLASS'
> JUCE\_DECLARE\_UUID\_GETTER (name, guid) \\
> ^
> /linux\_native/include/JUCE-6.1.5/modules/juce\_core/native/juce\_win32\_ComSmartPtr.h:41:24: note: expanded from macro 'JUCE\_DECLARE\_UUID\_GETTER'
> template \<\> struct UUIDGetter\<name\> { static CLSID get() { return uuidFromString (uuid); } };
> ^
> /linux\_native/include/JUCE-6.1.5/modules/juce\_core/native/juce\_win32\_ComSmartPtr.h:31:34: note: explicitly specialized declaration is here
> template \<typename Type\> struct UUIDGetter { static CLSID get() { jassertfalse; return {}; } };
> ^
> \`\`\`
> 
> \### What is the expected behaviour?
> 
> Successful compilation of x86 audio plugin.
> 
> \### Operating systems
> 
> Linux
> 
> \### What versions of the operating systems?
> 
> Ubuntu 22.04 cross-compiling for Windows 7 x86.
> 
> \### Architectures
> 
> 32-bit
> 
> \### Stacktrace
> 
> \`\`\`shell
> Full error here:  
> https://gist.github.com/Birch-san/5cc9ca55e789f38f7593ed6ebb033801
> 
> In file included from /linux\_native/include/JUCE-6.1.5/modules/juce\_gui\_basics/juce\_gui\_basics.cpp:309:
> /linux\_native/include/JUCE-6.1.5/modules/juce\_gui\_basics/native/accessibility/juce\_win32\_ComInterfaces.h:179:1: error: class template specialization of 'UUIDGetter' not in a namespace enclosing 'juce'
> JUCE\_COMCLASS (IRawElementProviderFragmentRoot, "620ce2a5-ab8f-40a9-86cb-de3c75599b58") : public IUnknown
> ^
> /linux\_native/include/JUCE-6.1.5/modules/juce\_core/native/juce\_win32\_ComSmartPtr.h:45:5: note: expanded from macro 'JUCE\_COMCLASS'
> JUCE\_DECLARE\_UUID\_GETTER (name, guid) \\
> ^
> /linux\_native/include/JUCE-6.1.5/modules/juce\_core/native/juce\_win32\_ComSmartPtr.h:41:24: note: expanded from macro 'JUCE\_DECLARE\_UUID\_GETTER'
> template \<\> struct UUIDGetter\<name\> { static CLSID get() { return uuidFromString (uuid); } };
> ^
> /linux\_native/include/JUCE-6.1.5/modules/juce\_core/native/juce\_win32\_ComSmartPtr.h:31:34: note: explicitly specialized declaration is here
> template \<typename Type\> struct UUIDGetter { static CLSID get() { jassertfalse; return {}; } };
> ^
> \`\`\`
> 
> 
> \### Plug-in formats (if applicable)
> 
> \_No response\_
> 
> \### Plug-in host applications (DAWs) (if applicable)
> 
> \_No response\_
> 
> \### Testing on the \`develop\` branch
> 
> I have not tested against the \`develop\` branch
> 
> \### Code of Conduct
> 
> \- \[X\] I agree to follow the Code of Conduct

> <https://github.com/juce-framework/JUCE/issues/1028>
>
> \### Detailed steps on how to reproduce the bug
> 
> \[Containerised repro\](https://…github.com/Birch-san/juce-repro) using JUCE audio plugin example:
> 
> \`\`\`bash
> git clone https://github.com/Birch-san/juce-repro.git
> cd juce-repro
> docker build .
> \`\`\`
> 
> \[\`juce\_win32\_ComInterfaces.h\`\](https://github.com/juce-framework/JUCE/blob/master/modules/juce\_gui\_basics/native/accessibility/juce\_win32\_ComInterfaces.h) attempts to define \`UIA\_\` constants. These clash with the macros defined in \[MinGW's \`uiautomationclient.h\`\](https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/include/uiautomationclient.h).
> 
> When we compile with \[llvm-mingw 20220209\](https://github.com/mstorsjo/llvm-mingw/releases/tag/20220209), we get the following error:
> 
> \`\`\`
> In file included from /linux\_native/include/JUCE-6.1.5/modules/juce\_gui\_basics/juce\_gui\_basics.cpp:309:
> /linux\_native/include/JUCE-6.1.5/modules/juce\_gui\_basics/native/accessibility/juce\_win32\_ComInterfaces.h:123:12: error: expected unqualified-id
> const long UIA\_InvokePatternId = 10000;
> ^
> /opt/llvm-mingw/x86\_64-w64-mingw32/include/uiautomationclient.h:34:30: note: expanded from macro 'UIA\_InvokePatternId'
> \#define UIA\_InvokePatternId (10000)
> \`\`\`
> 
> JUCE tries to \[declare a constant\](https://github.com/juce-framework/JUCE/blob/53b04877c6ebc7ef3cb42e84cb11a48e0cf809b5/modules/juce\_gui\_basics/native/accessibility/juce\_win32\_ComInterfaces.h#L123-L174):    
> 
> \`\`\`c++
> const long UIA\_InvokePatternId = 10000;
> \`\`\`
> 
> But the token \`UIA\_InvokePatternId\` \[already exists as a MinGW macro\](https://github.com/mingw-w64/mingw-w64/blob/2f6d8b806107cc8d543de2c9415a328a780a8267/mingw-w64-headers/include/uiautomationclient.h#L34-L450), and expands to \`(10000)\`, making the statement:
> 
> \`\`\`c++
> const long (10000) = 10000;
> \`\`\`
> 
> This compiles fine in \[llvm-mingw 20211002\](https://github.com/mstorsjo/llvm-mingw/releases/tag/20211002). Perhaps the MinGW \`uiautomationclient.h\` header was different back then?
> 
> I am currently working around the problem by \[telling MinGW not to define any \`UIA\_\` macros, and manually supplying the macros upon which JUCE depends\](https://github.com/Birch-san/juicysfplugin/blob/c95eb5755aab634a22dfa778912facd136590d5c/win32\_cross\_compile/configure\_juicysfplugin.sh#L82).
> 
> \### What is the expected behaviour?
> 
> Successful compilation. JUCE should not declare any constants whose names would clash with macros provided by MinGW.
> 
> \### Operating systems
> 
> Linux
> 
> \### What versions of the operating systems?
> 
> Ubuntu 22.04 cross-compiling for Windows 7 x86\_64
> 
> \### Architectures
> 
> x86\_64
> 
> \### Stacktrace
> 
> \`\`\`shell
> Full stack here:
> https://gist.github.com/Birch-san/0364f650a70505ce8c4b1859eab19b0e
> 
> In file included from /linux\_native/include/JUCE-6.1.5/modules/juce\_gui\_basics/juce\_gui\_basics.cpp:309:
> /linux\_native/include/JUCE-6.1.5/modules/juce\_gui\_basics/native/accessibility/juce\_win32\_ComInterfaces.h:123:12: error: expected unqualified-id
> const long UIA\_InvokePatternId = 10000;
> ^
> /opt/llvm-mingw/x86\_64-w64-mingw32/include/uiautomationclient.h:34:30: note: expanded from macro 'UIA\_InvokePatternId'
> \#define UIA\_InvokePatternId (10000)
> \`\`\`
> 
> 
> \### Plug-in formats (if applicable)
> 
> \_No response\_
> 
> \### Plug-in host applications (DAWs) (if applicable)
> 
> \_No response\_
> 
> \### Testing on the \`develop\` branch
> 
> I have not tested against the \`develop\` branch
> 
> \### Code of Conduct
> 
> \- \[X\] I agree to follow the Code of Conduct
