- Change typedef and const enums to not convert from literals by default. (#2934)

- Add `@constinit` to allow old typedef behaviour.
This commit is contained in:
Christoffer Lerno
2026-02-13 20:39:47 +01:00
committed by GitHub
parent bbf89815d6
commit e299a4b630
12 changed files with 37 additions and 19 deletions

View File

@@ -8,9 +8,9 @@ typedef NativeThread = int;
fn void NativeOnceFlag.call_once(&flag, OnceFn func)
{
if (*flag == 0)
if (*flag == (NativeOnceFlag)0)
{
*flag = 1;
*flag = (NativeOnceFlag)1;
func();
}
}