AmalgamEngine icon indicating copy to clipboard operation
AmalgamEngine copied to clipboard

Add jthread implementation for Clang

Open NeRdTheNed opened this issue 1 year ago • 2 comments

Clang does not yet implement jthread, causing builds with Clang to fail. This PR adds an implementation of jthread from https://github.com/StirlingLabs/jthread, which acts as a polyfill when building with a version of Clang which does not support jthread (currently all versions of Clang). This will allow future versions of Clang to build AmalgamEngine.

It's noted in Clang 16's future release notes that it will support parenthesised aggregate initialisation, the only other missing feature in Clang 15 required to build AmalgamEngine. After manually replacing all uses of parenthesised aggregate initialisation, AmalgamEngine is able to build with Clang 15, but the changes are somewhat intrusive and brittle, so it might just be best to wait for Clang 16 to release. Clang 16 seems to be at the release candidate stage, so it's likely to get a full release soon.

NeRdTheNed avatar Mar 08 '23 05:03 NeRdTheNed

Thanks for looking into this, I agree with waiting for Clang 16. If the gcc build doesn't need jthread, I think we should leave this PR for now and merge it as we make the switch. Sound good?

Net5F avatar Mar 09 '23 05:03 Net5F

I agree, I'll leave this open as-is for now.

NeRdTheNed avatar Mar 10 '23 22:03 NeRdTheNed