Merge branch 'master' into bill/sdl3

This commit is contained in:
gingerBill
2025-02-04 10:31:12 +00:00
24 changed files with 515 additions and 261 deletions
+3 -1
View File
@@ -10375,7 +10375,7 @@ gb_internal ExprKind check_type_assertion(CheckerContext *c, Operand *o, Ast *no
add_type_info_type(c, o->type);
o->type = type_hint;
o->mode = Addressing_OptionalOk;
return kind;
goto end;
}
}
@@ -10440,6 +10440,8 @@ gb_internal ExprKind check_type_assertion(CheckerContext *c, Operand *o, Ast *no
}
}
end:;
if ((c->state_flags & StateFlag_no_type_assert) == 0) {
add_package_dependency(c, "runtime", "type_assertion_check");
add_package_dependency(c, "runtime", "type_assertion_check2");
+4
View File
@@ -6319,6 +6319,10 @@ gb_internal void check_deferred_procedures(Checker *c) {
continue;
}
if (dst_params == nullptr) {
error(src->token, "Deferred procedure must have parameters for %s", attribute);
continue;
}
GB_ASSERT(dst_params->kind == Type_Tuple);
Type *tsrc = alloc_type_tuple();
+12 -1
View File
@@ -5837,9 +5837,20 @@ gb_inline isize gb_printf_err_va(char const *fmt, va_list va) {
}
gb_inline isize gb_fprintf_va(struct gbFile *f, char const *fmt, va_list va) {
gb_local_persist char buf[4096];
char buf[4096];
isize len = gb_snprintf_va(buf, gb_size_of(buf), fmt, va);
char *new_buf = NULL;
isize n = gb_size_of(buf);
while (len < 0) {
n <<= 1;
gb_free(gb_heap_allocator(), new_buf);
new_buf = gb_alloc_array(gb_heap_allocator(), char, n);;
len = gb_snprintf_va(new_buf, n, fmt, va);
}
gb_file_write(f, buf, len-1); // NOTE(bill): prevent extra whitespace
if (new_buf != NULL) {
gb_free(gb_heap_allocator(), new_buf);
}
return len;
}