Hi JUCE devs!
Have you any timescale for adding support for using JUCE with C++20?
I just gave it a go with Xcode 13, and found that JUCE doesn’t compile (at least, on macOS - didn’t try with Android / Windows).
It’d be a lovely thing
Best wishes,
Pete
What errors are you seeing? I have C++20 set as my language standard and Juce compiles just fine
kamedin
September 25, 2021, 3:22am
3
I’ve only disabled char8_t, which doesn’t work with CharPointer_UTF8 constructors. Everything else seems to be fine.
Hi @benvining errors compiling on macOS?
e.g. compiling this code in the JUCE library:
CFObjectHolder<CFStringRef> contextName { properties.name.toCFString() };
@kamedin how do you disable char8_t …?!
Thanks folks,
Pete
...modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm:1335:41:
No matching constructor for initialization of 'CFObjectHolder<CFStringRef>'
(aka 'CFObjectHolder<const __CFString *>')
in file included from
...modules/juce_audio_processors/juce_audio_processors.cpp:198:
Did you try compiling in Xcode 13 without C++20? It might be an Xcode 13 issue rather than a C++20 issue, or a combination of both.
kamedin
September 25, 2021, 11:39am
7
With a compiler option. In GCC and Clang, -fno-char8_t
. In MSVC, /Zc:char8_t-
. Doesn’t seem like the CFObjectHolder
issue has to do with C++20, but I’m not on Mac to check it.
1 Like
Hi @kamedin thank you very much, that flag was a great tip!
@ed95 this was my fix for the juce_AudioUnitPluginFormat.mm file …:
- CFObjectHolder<CFStringRef> contextName { properties.name.toCFString() };
+ CFObjectHolder<CFStringRef> contextName;
+ contextName.object = properties.name.toCFString();
- CFObjectHolder<CFPropertyListRef> propertyList { CFPropertyListCreateFromStream (kCFAllocatorDefault, stream.get(), 0,
- kCFPropertyListImmutable, &format, nullptr) };
+ CFObjectHolder<CFPropertyListRef> propertyList;
+ propertyList.object = CFPropertyListCreateFromStream (kCFAllocatorDefault, stream.get(), 0,
+ kCFPropertyListImmutable, &format, nullptr);
Hoping this helps!
Pete
modosc
September 26, 2021, 9:23pm
9
i filed this bug a few weeks back.
2 Likes
ed95
September 29, 2021, 2:02pm
10
This has been fixed on the develop
branch here:
committed 09:20AM - 28 Sep 21 UTC
We’ve also added support to the Projucer for setting the project language standard to C++20:
committed 01:50PM - 05 Aug 20 UTC
2 Likes