This commit is contained in:
krzosa
2025-01-03 22:14:34 +01:00
parent de12ea371e
commit 1fca44fcfc
11 changed files with 190 additions and 168 deletions

View File

@@ -37,17 +37,17 @@ while (true) {
*/ */
glb_wasm_export char wasm_temp_buff1[128] = {[127] = 0x13}; gb_wasm_export char wasm_temp_buff1[128] = {[127] = 0x13};
glb_wasm_export i32 wasm_temp_buff1_len = 127; gb_wasm_export i32 wasm_temp_buff1_len = 127;
glb_wasm_export char wasm_temp_buff2[128] = {[127] = 0x13}; gb_wasm_export char wasm_temp_buff2[128] = {[127] = 0x13};
glb_wasm_export i32 wasm_temp_buff2_len = 127; gb_wasm_export i32 wasm_temp_buff2_len = 127;
global f64 wasm_dpr; gb f64 wasm_dpr;
global f64 wasm_delta_time; gb f64 wasm_delta_time;
global f64 wasm_time; gb f64 wasm_time;
global f64 wasm_last_time; gb f64 wasm_last_time;
global f64 wasm_app_init_time; gb f64 wasm_app_init_time;
global app_event_list_t wasm_event_list; gb app_event_list_t wasm_event_list;
typedef struct wasm_cached_t wasm_cached_t; typedef struct wasm_cached_t wasm_cached_t;
struct wasm_cached_t { struct wasm_cached_t {

View File

@@ -5,19 +5,17 @@
#include "app.gen.c" #include "app.gen.c"
#include "app_win32_opengl.c" #include "app_win32_opengl.c"
#include <windowsx.h>
#pragma comment(linker, "/subsystem:windows") #pragma comment(linker, "/subsystem:windows")
#pragma comment(lib, "gdi32.lib") #pragma comment(lib, "gdi32.lib")
#pragma comment(lib, "user32.lib") #pragma comment(lib, "user32.lib")
#pragma comment(lib, "winmm.lib") #pragma comment(lib, "winmm.lib")
b32 w32_good_scheduling; gb b32 w32_good_scheduling;
WNDCLASSW w32_wc; gb WNDCLASSW w32_wc;
HWND w32_window_handle; gb HWND w32_window_handle;
HDC w32_dc; gb HDC w32_dc;
b32 w32_quit_app; gb b32 w32_quit_app;
fn v2f64_t w32_get_window_size(HWND window) { fn v2f64_t w32_get_window_size(HWND window) {
RECT window_rect; RECT window_rect;
@@ -45,8 +43,8 @@ fn f64 w32_get_dpr(HWND window_handle) {
/////////////////////////////// ///////////////////////////////
// event processing // event processing
app_event_list_t w32_event_list; gb app_event_list_t w32_event_list;
ma_arena_t *w32_event_arena; gb ma_arena_t *w32_event_arena;
fn void w32_push_event(app_event_t event) { fn void w32_push_event(app_event_t event) {
app_event_t *ev = ma_push_type(w32_event_arena, app_event_t); app_event_t *ev = ma_push_type(w32_event_arena, app_event_t);

View File

@@ -52,17 +52,17 @@ typedef BOOL MU_wglSwapIntervalEXT(int interval);
#define WGL_SAMPLE_BUFFERS_ARB 0x2041 #define WGL_SAMPLE_BUFFERS_ARB 0x2041
#define WGL_SAMPLES_ARB 0x2042 #define WGL_SAMPLES_ARB 0x2042
global MU_wglChoosePixelFormatARB *wglChoosePixelFormatARB; gb MU_wglChoosePixelFormatARB *wglChoosePixelFormatARB;
global MU_wglCreateContextAttribsARB *wglCreateContextAttribsARB; gb MU_wglCreateContextAttribsARB *wglCreateContextAttribsARB;
global MU_wglSwapIntervalEXT *wglSwapIntervalEXT; gb MU_wglSwapIntervalEXT *wglSwapIntervalEXT;
global MU_glGetProcAddress *wgl_get_proc_address; gb MU_glGetProcAddress *wgl_get_proc_address;
global void *(*gl_get_proc_address)(const char *str); gb void *(*gl_get_proc_address)(const char *str);
global HMODULE opengl_hmodule; gb HMODULE opengl_hmodule;
global HGLRC(*mu_wglCreateContext)(HDC unnamedParam1); gb HGLRC(*mu_wglCreateContext)(HDC unnamedParam1);
global BOOL(*mu_wglMakeCurrent)(HDC unnamedParam1, HGLRC unnamedParam2); gb BOOL(*mu_wglMakeCurrent)(HDC unnamedParam1, HGLRC unnamedParam2);
global BOOL(*mu_wglDeleteContext)(HGLRC unnamedParam1); gb BOOL(*mu_wglDeleteContext)(HGLRC unnamedParam1);
// compares src string with dstlen characters from dst, returns 1 if they are equal, 0 if not // compares src string with dstlen characters from dst, returns 1 if they are equal, 0 if not
fn int w32_are_strings_equal(const char *src, const char *dst, size_t dstlen) { fn int w32_are_strings_equal(const char *src, const char *dst, size_t dstlen) {

View File

@@ -26,11 +26,11 @@ typedef double f64;
#endif #endif
#define fn #define fn
#define global #define gb
#define locl #define locl
#if PLATFORM_WASM #if PLATFORM_WASM
#define glb_wasm_export __attribute__((visibility("default"))) #define gb_wasm_export __attribute__((visibility("default")))
#define fn_wasm_export __attribute__((visibility("default"))) #define fn_wasm_export __attribute__((visibility("default")))
#define fn_wasm_import #define fn_wasm_import
#endif #endif
@@ -77,6 +77,23 @@ typedef double f64;
#define SWAP(t, a, b) do { t PASTE(temp__, __LINE__) = a; a = b; b = PASTE(temp__, __LINE__); } while(0) #define SWAP(t, a, b) do { t PASTE(temp__, __LINE__) = a; a = b; b = PASTE(temp__, __LINE__); } while(0)
#define CODE(...) #__VA_ARGS__ #define CODE(...) #__VA_ARGS__
#if PLATFORM_CL || (PLATFORM_CLANG && PLATFORM_WINDOWS)
#pragma section(".rdata$", read)
#define gb_read_only __declspec(allocate(".rdata$"))
#elif PLATFORM_CLANG && PLATFORM_LINUX
#define gb_read_only __attribute__((section(".rodata")))
#else
#define gb_read_only
#endif
#if PLATFORM_CL
#define fn_force_inline __forceinline
#elif PLATFORM_CLANG || PLATFORM_GCC
#define fn_force_inline __attribute__((always_inline))
#else
#define fn_force_inline
#endif
#ifndef FILE_AND_LINE_GCC_FORMAT #ifndef FILE_AND_LINE_GCC_FORMAT
#define FILE_AND_LINE __FILE__"("STRINGIFY(__LINE__)")" #define FILE_AND_LINE __FILE__"("STRINGIFY(__LINE__)")"
#else #else

View File

@@ -15,7 +15,7 @@ struct ma_arena_t {
typedef struct ma_temp_t ma_temp_t; typedef struct ma_temp_t ma_temp_t;
struct ma_temp_t { struct ma_temp_t {
ma_arena_t *arena; ma_arena_t *arena;
usize len; usize len;
}; };
// //
@@ -30,8 +30,8 @@ fn void *ma_push_size(ma_arena_t *arena, usize size);
fn void *ma_push_size_ex(ma_arena_t *arena, usize size); fn void *ma_push_size_ex(ma_arena_t *arena, usize size);
fn ma_arena_t *ma_push_arena(ma_arena_t *allocator, usize size); fn ma_arena_t *ma_push_arena(ma_arena_t *allocator, usize size);
fn void ma_push_arena_ex(ma_arena_t *allocator, ma_arena_t *result, usize size); fn void ma_push_arena_ex(ma_arena_t *allocator, ma_arena_t *result, usize size);
#define ma_push_type(arena, Type) (Type *)ma_push_size((arena), sizeof(Type)) #define ma_push_type(arena, Type) (Type *)ma_push_size((arena), sizeof(Type))
#define ma_push_array(arena, Type, count) (Type *)ma_push_size((arena), sizeof(Type) * (count)) #define ma_push_array(arena, Type, count) (Type *)ma_push_size((arena), sizeof(Type) * (count))
// //
// pop // pop
@@ -50,5 +50,5 @@ fn void ma_end_temp(ma_temp_t temp);
fn ma_temp_t ma_begin_scratch_ex(ma_arena_t **conflicts, int conflict_count); fn ma_temp_t ma_begin_scratch_ex(ma_arena_t **conflicts, int conflict_count);
fn ma_temp_t ma_begin_scratch(void); fn ma_temp_t ma_begin_scratch(void);
fn ma_temp_t ma_begin_scratch1(ma_arena_t *conflict); fn ma_temp_t ma_begin_scratch1(ma_arena_t *conflict);
#define ma_end_scratch(x) ma_end_temp(x) #define ma_end_scratch(x) ma_end_temp(x)
#define ma_scratch_scope(x) for (ma_temp_t x = ma_begin_scratch(); x.arena; (ma_end_temp(x), x.arena = 0)) #define ma_scratch_scope(x) for (ma_temp_t x = ma_begin_scratch(); x.arena; (ma_end_temp(x), x.arena = 0))

View File

@@ -5,7 +5,7 @@ struct thread_ctx_t {
// I probably want to discourage using it implicitly like: tcx.perm, instead just pass it around // I probably want to discourage using it implicitly like: tcx.perm, instead just pass it around
// to functions that allocate pernament memory. temp and scratch very nicely create reusable code // to functions that allocate pernament memory. temp and scratch very nicely create reusable code
// perm is basically global state so it would be nice to annotate which functions are reusable // perm is basically gb state so it would be nice to annotate which functions are reusable
// and which functions have state // and which functions have state
ma_arena_t _perm; ma_arena_t _perm;

View File

@@ -257,7 +257,7 @@ fn lex_array_t lex_tokens(ma_arena_t *arena, char *file_name, s8_t stream) {
return token_array; return token_array;
} }
global s8_t global_lex_kind_simple_strings[] = { gb_read_only s8_t lex_kind_simple_strings[] = {
#define X(KIND, STR, SIMPLE) s8_const_lit(SIMPLE), #define X(KIND, STR, SIMPLE) s8_const_lit(SIMPLE),
LEX_KIND_XLIST LEX_KIND_XLIST
#undef X #undef X
@@ -265,10 +265,10 @@ global s8_t global_lex_kind_simple_strings[] = {
fn s8_t lex_kind_to_simple_s8(lex_kind_t kind) { fn s8_t lex_kind_to_simple_s8(lex_kind_t kind) {
assert(kind >= 0 && kind < lex_kind_count); assert(kind >= 0 && kind < lex_kind_count);
return global_lex_kind_simple_strings[kind]; return lex_kind_simple_strings[kind];
} }
global s8_t global_lex_kind_strings[] = { gb_read_only s8_t lex_kind_strings[] = {
#define X(KIND, STR, SIMPLE) s8_const_lit(STR), #define X(KIND, STR, SIMPLE) s8_const_lit(STR),
LEX_KIND_XLIST LEX_KIND_XLIST
#undef X #undef X
@@ -276,7 +276,7 @@ global s8_t global_lex_kind_strings[] = {
fn s8_t lex_kind_to_s8(lex_kind_t kind) { fn s8_t lex_kind_to_s8(lex_kind_t kind) {
assert(kind >= 0 && kind < lex_kind_count); assert(kind >= 0 && kind < lex_kind_count);
return global_lex_kind_strings[kind]; return lex_kind_strings[kind];
} }
fn lex_t *parser_next(parser_t *par) { fn lex_t *parser_next(parser_t *par) {

View File

@@ -1,63 +1,63 @@
typedef enum lex_kind_t lex_kind_t; typedef enum lex_kind_t lex_kind_t;
enum lex_kind_t { enum lex_kind_t {
#define LEX_KIND_XLIST\ #define LEX_KIND_XLIST\
X(eof, "end of file", "---")\ X(lex_kind_eof , "end of file" , "---" )\
X(error, "error", "---")\ X(lex_kind_error , "error" , "---" )\
X(integer, "integer", "---")\ X(lex_kind_integer , "integer" , "---" )\
X(real, "real", "---")\ X(lex_kind_real , "real" , "---" )\
X(ident, "identifier", "---")\ X(lex_kind_ident , "identifier" , "---" )\
X(string, "string", "---")\ X(lex_kind_string , "string" , "---" )\
X(comment, "comment", "---")\ X(lex_kind_comment , "comment" , "---" )\
X(open_brace, "'{' open brace", "{")\ X(lex_kind_open_brace , "'{' open brace" , "{" )\
X(close_brace, "'}' close brace", "}")\ X(lex_kind_close_brace , "'}' close brace" , "}" )\
X(open_paren, "'(' open parenthesis", "(")\ X(lex_kind_open_paren , "'(' open parenthesis" , "(" )\
X(close_paren, "')' close parenthesis", ")")\ X(lex_kind_close_paren , "')' close parenthesis" , ")" )\
X(open_bracket, "'[' open bracket", "[")\ X(lex_kind_open_bracket , "'[' open bracket" , "[" )\
X(close_bracket, "']' close bracket", "]")\ X(lex_kind_close_bracket , "']' close bracket" , "]" )\
X(plus, "'+' plus", "+")\ X(lex_kind_plus , "'+' plus" , "+" )\
X(minus, "'-' minus", "-")\ X(lex_kind_minus , "'-' minus" , "-" )\
X(divide, "'/' division sign", "/")\ X(lex_kind_divide , "'/' division sign" , "/" )\
X(multiply, "'*' multiplication sign", "*")\ X(lex_kind_multiply , "'*' multiplication sign" , "*" )\
X(modulo, "'%' modulo", "%")\ X(lex_kind_modulo , "'%' modulo" , "%" )\
X(or, "'||' logical or", "||")\ X(lex_kind_or , "'||' logical or" , "||" )\
X(and, "'&&' logical and", "&&")\ X(lex_kind_and , "'&&' logical and" , "&&" )\
X(negation, "'!' logical negation", "!")\ X(lex_kind_negation , "'!' logical negation" , "!" )\
X(bit_negation, "'~' bit negation", "~")\ X(lex_kind_bit_negation , "'~' bit negation" , "~" )\
X(bit_left_shift, "'<<' bit left shift", "<<")\ X(lex_kind_bit_left_shift , "'<<' bit left shift" , "<<" )\
X(bit_right_shift, "'>>' bit right shift", ">>")\ X(lex_kind_bit_right_shift , "'>>' bit right shift" , ">>" )\
X(bit_or, "'|' bit or", "|")\ X(lex_kind_bit_or , "'|' bit or" , "|" )\
X(bit_and, "'&' bit and", "&")\ X(lex_kind_bit_and , "'&' bit and" , "&" )\
X(bit_xor, "'^' bit xor", "^")\ X(lex_kind_bit_xor , "'^' bit xor" , "^" )\
X(decrement, "'--' decrement", "--")\ X(lex_kind_decrement , "'--' decrement" , "--" )\
X(increment, "'++' increment", "++")\ X(lex_kind_increment , "'++' increment" , "++" )\
X(post_decrement, "'--' post decrement", "--")\ X(lex_kind_post_decrement , "'--' post decrement" , "--" )\
X(post_increment, "'++' post increment", "++")\ X(lex_kind_post_increment , "'++' post increment" , "++" )\
X(assign, "'=' assignment", "=")\ X(lex_kind_assign , "'=' assignment" , "=" )\
X(divide_assign, "'/=' divide assignment", "/=")\ X(lex_kind_divide_assign , "'/=' divide assignment" , "/=" )\
X(multiply_assign, "'*=' multiply assignment", "*=")\ X(lex_kind_multiply_assign , "'*=' multiply assignment" , "*=" )\
X(plus_assign, "'+=' plus assignment", "+=")\ X(lex_kind_plus_assign , "'+=' plus assignment" , "+=" )\
X(minus_assign, "'-=' minus assignment", "-=")\ X(lex_kind_minus_assign , "'-=' minus assignment" , "-=" )\
X(modulo_assign, "'%=' modulo assignment", "%=")\ X(lex_kind_modulo_assign , "'%=' modulo assignment" , "%=" )\
X(bit_and_assign, "&=", "&=")\ X(lex_kind_bit_and_assign , "'&=' bit and assignment" , "&=" )\
X(bit_or_assign, "'|=' bit or assignment", "|=")\ X(lex_kind_bit_or_assign , "'|=' bit or assignment" , "|=" )\
X(bit_xor_assign, "'^=' bit xor assignment", "^=")\ X(lex_kind_bit_xor_assign , "'^=' bit xor assignment" , "^=" )\
X(bit_left_shift_assign, "'<<=' bit left shift assignment", "<<=")\ X(lex_kind_bit_left_shift_assign , "'<<=' bit left shift assignment" , "<<=" )\
X(bit_right_shift_assign, "'>>=' bit right shift assignment", ">>=")\ X(lex_kind_bit_right_shift_assign , "'>>=' bit right shift assignment" , ">>=" )\
X(equals, "'==' equals sign", "==")\ X(lex_kind_equals , "'==' equals sign" , "==" )\
X(not_equals, "'!=' not equals sign", "!=")\ X(lex_kind_not_equals , "'!=' not equals sign" , "!=" )\
X(lesser, "'<' lesser then", "<")\ X(lex_kind_lesser , "'<' lesser then" , "<" )\
X(greater, "'>' greater then", ">")\ X(lex_kind_greater , "'>' greater then" , ">" )\
X(lesser_or_equal, "'<=' lesser then or equal", "<=")\ X(lex_kind_lesser_or_equal , "'<=' lesser then or equal" , "<=" )\
X(greater_or_equal, "'>=' greater then or equal", ">=")\ X(lex_kind_greater_or_equal , "'>=' greater then or equal" , ">=" )\
X(comma, "',' comma", ",")\ X(lex_kind_comma , "',' comma" , "," )\
X(dot, "'.' dot", ".")\ X(lex_kind_dot , "'.' dot" , "." )\
X(three_dots, "'...' three dots", "...")\ X(lex_kind_three_dots , "'...' three dots" , "..." )\
X(semicolon, "';' semicolon", ";")\ X(lex_kind_semicolon , "';' semicolon" , ";" )\
X(colon, "':' colon", ":")\ X(lex_kind_colon , "':' colon" , ":" )\
X(arrow, "'->' arrow", "->")\ X(lex_kind_arrow , "'->' arrow" , "->" )\
X(question, "'?' question mark", "?")\ X(lex_kind_question , "'?' question mark" , "?" )\
#define X(KIND, STR, SIMPLE) lex_kind_##KIND, #define X(KIND, STR, SIMPLE) KIND,
LEX_KIND_XLIST LEX_KIND_XLIST
#undef X #undef X
@@ -66,8 +66,17 @@ enum lex_kind_t {
typedef enum lex_suffix_t lex_suffix_t; typedef enum lex_suffix_t lex_suffix_t;
enum lex_suffix_t { enum lex_suffix_t {
#define LEX_SUFFIX_XLIST X(none) X(f) X(d) X(u) X(ul) X(ull) X(l) X(ll) #define LEX_SUFFIX_XLIST\
#define X(KIND) lex_suffix_##KIND, X(lex_suffix_none) \
X(lex_suffix_f) \
X(lex_suffix_d) \
X(lex_suffix_u) \
X(lex_suffix_ul) \
X(lex_suffix_ull) \
X(lex_suffix_l) \
X(lex_suffix_ll) \
#define X(KIND) KIND,
LEX_SUFFIX_XLIST LEX_SUFFIX_XLIST
#undef X #undef X
@@ -120,8 +129,7 @@ struct parser_t {
lex_t *at; lex_t *at;
}; };
#define parser_make(ARENA, TOKEN) &(parser_t){.arena = ARENA, .at = TOKEN} #define parser_make(ARENA, TOKEN) &(parser_t){.arena = ARENA, .at = TOKEN}
fn lex_t *parser_next(parser_t *par); fn lex_t *parser_next(parser_t *par);
fn lex_t *parser_match(parser_t *par, lex_kind_t kind); fn lex_t *parser_match(parser_t *par, lex_kind_t kind);
fn lex_t *parser_matchi(parser_t *par, s8_t str); fn lex_t *parser_matchi(parser_t *par, s8_t str);

View File

@@ -205,9 +205,9 @@ union r3i64_t {
#define rgba_macro_const(r, g, b, a) { r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f } #define rgba_macro_const(r, g, b, a) { r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f }
global v4f32_t primary_color_global = rgba_macro_const(245, 238, 230, 255); gb_read_only v4f32_t primary_color_global = rgba_macro_const(245, 238, 230, 255);
global v4f32_t secondary_color_global = rgba_macro_const(255, 248, 227, 255); gb_read_only v4f32_t secondary_color_global = rgba_macro_const(255, 248, 227, 255);
global v4f32_t accent1_color_global = rgba_macro_const(243, 215, 202, 255); gb_read_only v4f32_t accent1_color_global = rgba_macro_const(243, 215, 202, 255);
global v4f32_t accent2_color_global = rgba_macro_const(230, 164, 180, 255); gb_read_only v4f32_t accent2_color_global = rgba_macro_const(230, 164, 180, 255);
global v4f32_t white_color_global = rgba_macro_const(255, 255, 255, 255); gb_read_only v4f32_t white_color_global = rgba_macro_const(255, 255, 255, 255);
global v4f32_t black_color_global = rgba_macro_const(0, 0, 0, 255); gb_read_only v4f32_t black_color_global = rgba_macro_const(0, 0, 0, 255);

View File

@@ -69,47 +69,47 @@ fn type_member_t *ti_get_member(s8_t name, type_t *type);
#define DEFINE_STRUCT(x) type_t type__##x = {type_kind_struct, s8_const_lit(#x), sizeof(x), .members = members__##x, .count = lengthof(members__##x)} #define DEFINE_STRUCT(x) type_t type__##x = {type_kind_struct, s8_const_lit(#x), sizeof(x), .members = members__##x, .count = lengthof(members__##x)}
#define POINTER(x) (type_t){type_kind_pointer, s8_const_lit(#x "*"), sizeof(void *), .base = &type__##x} #define POINTER(x) (type_t){type_kind_pointer, s8_const_lit(#x "*"), sizeof(void *), .base = &type__##x}
global type_t type__i8 = {type_kind_i8, s8_const_lit("i8"), sizeof(i8)}; gb_read_only type_t type__i8 = {type_kind_i8, s8_const_lit("i8"), sizeof(i8)};
global type_t type__i16 = {type_kind_i16, s8_const_lit("i16"), sizeof(i16)}; gb_read_only type_t type__i16 = {type_kind_i16, s8_const_lit("i16"), sizeof(i16)};
global type_t type__i32 = {type_kind_i32, s8_const_lit("i32"), sizeof(i32)}; gb_read_only type_t type__i32 = {type_kind_i32, s8_const_lit("i32"), sizeof(i32)};
global type_t type__i64 = {type_kind_i64, s8_const_lit("i64"), sizeof(i64)}; gb_read_only type_t type__i64 = {type_kind_i64, s8_const_lit("i64"), sizeof(i64)};
global type_t type__u8 = {type_kind_u8, s8_const_lit("u8"), sizeof(u8)}; gb_read_only type_t type__u8 = {type_kind_u8, s8_const_lit("u8"), sizeof(u8)};
global type_t type__u16 = {type_kind_u16, s8_const_lit("u16"), sizeof(u16)}; gb_read_only type_t type__u16 = {type_kind_u16, s8_const_lit("u16"), sizeof(u16)};
global type_t type__u32 = {type_kind_u32, s8_const_lit("u32"), sizeof(u32)}; gb_read_only type_t type__u32 = {type_kind_u32, s8_const_lit("u32"), sizeof(u32)};
global type_t type__u64 = {type_kind_u64, s8_const_lit("u64"), sizeof(u64)}; gb_read_only type_t type__u64 = {type_kind_u64, s8_const_lit("u64"), sizeof(u64)};
global type_t type__b8 = {type_kind_b8, s8_const_lit("b8"), sizeof(b8)}; gb_read_only type_t type__b8 = {type_kind_b8, s8_const_lit("b8"), sizeof(b8)};
global type_t type__b16 = {type_kind_b16, s8_const_lit("b16"), sizeof(b16)}; gb_read_only type_t type__b16 = {type_kind_b16, s8_const_lit("b16"), sizeof(b16)};
global type_t type__b32 = {type_kind_b32, s8_const_lit("b32"), sizeof(b32)}; gb_read_only type_t type__b32 = {type_kind_b32, s8_const_lit("b32"), sizeof(b32)};
global type_t type__b64 = {type_kind_b64, s8_const_lit("b64"), sizeof(b64)}; gb_read_only type_t type__b64 = {type_kind_b64, s8_const_lit("b64"), sizeof(b64)};
global type_t type__f32 = {type_kind_f32, s8_const_lit("f32"), sizeof(f32)}; gb_read_only type_t type__f32 = {type_kind_f32, s8_const_lit("f32"), sizeof(f32)};
global type_t type__f64 = {type_kind_f64, s8_const_lit("f64"), sizeof(f64)}; gb_read_only type_t type__f64 = {type_kind_f64, s8_const_lit("f64"), sizeof(f64)};
global type_t type__isize = {type_kind_isize, s8_const_lit("isize"), sizeof(isize)}; gb_read_only type_t type__isize = {type_kind_isize, s8_const_lit("isize"), sizeof(isize)};
global type_t type__usize = {type_kind_usize, s8_const_lit("usize"), sizeof(usize)}; gb_read_only type_t type__usize = {type_kind_usize, s8_const_lit("usize"), sizeof(usize)};
global type_t type__int = {type_kind_int, s8_const_lit("int"), sizeof(int)}; gb_read_only type_t type__int = {type_kind_int, s8_const_lit("int"), sizeof(int)};
global type_t type__char = {type_kind_char, s8_const_lit("char"), sizeof(char)}; gb_read_only type_t type__char = {type_kind_char, s8_const_lit("char"), sizeof(char)};
global type_t type__s8_t = { type_kind_struct, s8_const_lit("s8_t"), sizeof(s8_t), .count = 2, gb_read_only type_t type__s8_t = { type_kind_struct, s8_const_lit("s8_t"), sizeof(s8_t), .count = 2,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("str"), &POINTER(char), .offset = offsetof(s8_t, str)}, {s8_const_lit("str"), &POINTER(char), .offset = offsetof(s8_t, str)},
{s8_const_lit("len"), &type__i64, .offset = offsetof(s8_t, len)}, {s8_const_lit("len"), &type__i64, .offset = offsetof(s8_t, len)},
} }
}; };
global type_t type__s16_t = { type_kind_struct, s8_const_lit("s16_t"), sizeof(s16_t), .count = 2, gb_read_only type_t type__s16_t = { type_kind_struct, s8_const_lit("s16_t"), sizeof(s16_t), .count = 2,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("str"), &POINTER(u16), .offset = offsetof(s16_t, str)}, {s8_const_lit("str"), &POINTER(u16), .offset = offsetof(s16_t, str)},
{s8_const_lit("len"), &type__i64, .offset = offsetof(s16_t, len)}, {s8_const_lit("len"), &type__i64, .offset = offsetof(s16_t, len)},
} }
}; };
global type_t type__s32_t = { type_kind_struct, s8_const_lit("s32_t"), sizeof(s32_t), .count = 2, gb_read_only type_t type__s32_t = { type_kind_struct, s8_const_lit("s32_t"), sizeof(s32_t), .count = 2,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("str"), &POINTER(u32), .offset = offsetof(s32_t, str)}, {s8_const_lit("str"), &POINTER(u32), .offset = offsetof(s32_t, str)},
{s8_const_lit("len"), &type__i64, .offset = offsetof(s32_t, len)}, {s8_const_lit("len"), &type__i64, .offset = offsetof(s32_t, len)},
} }
}; };
global type_t type__ma_arena_t = { type_kind_struct, s8_const_lit("ma_arena_t"), sizeof(ma_arena_t), .count = 6, gb_read_only type_t type__ma_arena_t = { type_kind_struct, s8_const_lit("ma_arena_t"), sizeof(ma_arena_t), .count = 6,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("data"), &POINTER(u8), .offset = offsetof(ma_arena_t, data)}, {s8_const_lit("data"), &POINTER(u8), .offset = offsetof(ma_arena_t, data)},
{s8_const_lit("len"), &type__usize, .offset = offsetof(ma_arena_t, len)}, {s8_const_lit("len"), &type__usize, .offset = offsetof(ma_arena_t, len)},
@@ -120,21 +120,21 @@ global type_t type__ma_arena_t = { type_kind_struct, s8_const_lit("ma_arena_t"),
} }
}; };
global type_t type__ma_temp_t = { type_kind_struct, s8_const_lit("ma_temp_t"), sizeof(ma_temp_t), .count = 2, gb_read_only type_t type__ma_temp_t = { type_kind_struct, s8_const_lit("ma_temp_t"), sizeof(ma_temp_t), .count = 2,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("arena"), &POINTER(ma_arena_t), .offset = offsetof(ma_temp_t, arena)}, {s8_const_lit("arena"), &POINTER(ma_arena_t), .offset = offsetof(ma_temp_t, arena)},
{s8_const_lit("len"), &type__usize, .offset = offsetof(ma_temp_t, len)}, {s8_const_lit("len"), &type__usize, .offset = offsetof(ma_temp_t, len)},
} }
}; };
global type_t type__v2f32_t = { type_kind_struct, s8_const_lit("v2f32_t"), sizeof(v2f32_t), .count = 2, gb_read_only type_t type__v2f32_t = { type_kind_struct, s8_const_lit("v2f32_t"), sizeof(v2f32_t), .count = 2,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("x"), &type__f32, .offset = offsetof(v2f32_t, x)}, {s8_const_lit("x"), &type__f32, .offset = offsetof(v2f32_t, x)},
{s8_const_lit("y"), &type__f32, .offset = offsetof(v2f32_t, y)}, {s8_const_lit("y"), &type__f32, .offset = offsetof(v2f32_t, y)},
} }
}; };
global type_t type__v3f32_t = { type_kind_struct, s8_const_lit("v3f32_t"), sizeof(v3f32_t), .count = 3, gb_read_only type_t type__v3f32_t = { type_kind_struct, s8_const_lit("v3f32_t"), sizeof(v3f32_t), .count = 3,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("x"), &type__f32, .offset = offsetof(v3f32_t, x)}, {s8_const_lit("x"), &type__f32, .offset = offsetof(v3f32_t, x)},
{s8_const_lit("y"), &type__f32, .offset = offsetof(v3f32_t, y)}, {s8_const_lit("y"), &type__f32, .offset = offsetof(v3f32_t, y)},
@@ -142,7 +142,7 @@ global type_t type__v3f32_t = { type_kind_struct, s8_const_lit("v3f32_t"), sizeo
} }
}; };
global type_t type__v4f32_t = { type_kind_struct, s8_const_lit("v4f32_t"), sizeof(v4f32_t), .count = 4, gb_read_only type_t type__v4f32_t = { type_kind_struct, s8_const_lit("v4f32_t"), sizeof(v4f32_t), .count = 4,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("x"), &type__f32, .offset = offsetof(v4f32_t, x)}, {s8_const_lit("x"), &type__f32, .offset = offsetof(v4f32_t, x)},
{s8_const_lit("y"), &type__f32, .offset = offsetof(v4f32_t, y)}, {s8_const_lit("y"), &type__f32, .offset = offsetof(v4f32_t, y)},
@@ -151,7 +151,7 @@ global type_t type__v4f32_t = { type_kind_struct, s8_const_lit("v4f32_t"), sizeo
} }
}; };
global type_t type__r3f32_t = { type_kind_struct, s8_const_lit("r3f32_t"), sizeof(r3f32_t), .count = 6, gb_read_only type_t type__r3f32_t = { type_kind_struct, s8_const_lit("r3f32_t"), sizeof(r3f32_t), .count = 6,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("x0"), &type__f32, .offset = offsetof(r3f32_t, x0)}, {s8_const_lit("x0"), &type__f32, .offset = offsetof(r3f32_t, x0)},
{s8_const_lit("y0"), &type__f32, .offset = offsetof(r3f32_t, y0)}, {s8_const_lit("y0"), &type__f32, .offset = offsetof(r3f32_t, y0)},
@@ -162,28 +162,28 @@ global type_t type__r3f32_t = { type_kind_struct, s8_const_lit("r3f32_t"), sizeo
} }
}; };
global type_member_t members__r2f32_t[] = { gb_read_only type_member_t members__r2f32_t[] = {
{s8_const_lit("x0"), &type__f32, .offset = offsetof(r2f32_t, x0)}, {s8_const_lit("x0"), &type__f32, .offset = offsetof(r2f32_t, x0)},
{s8_const_lit("y0"), &type__f32, .offset = offsetof(r2f32_t, y0)}, {s8_const_lit("y0"), &type__f32, .offset = offsetof(r2f32_t, y0)},
{s8_const_lit("x1"), &type__f32, .offset = offsetof(r2f32_t, x1)}, {s8_const_lit("x1"), &type__f32, .offset = offsetof(r2f32_t, x1)},
{s8_const_lit("y1"), &type__f32, .offset = offsetof(r2f32_t, y1)}, {s8_const_lit("y1"), &type__f32, .offset = offsetof(r2f32_t, y1)},
}; };
global DEFINE_STRUCT(r2f32_t); gb_read_only DEFINE_STRUCT(r2f32_t);
global type_member_t members__r1f32_t[] = { gb_read_only type_member_t members__r1f32_t[] = {
{s8_const_lit("x0"), &type__f32, .offset = offsetof(r1f32_t, x0)}, {s8_const_lit("x0"), &type__f32, .offset = offsetof(r1f32_t, x0)},
{s8_const_lit("x1"), &type__f32, .offset = offsetof(r1f32_t, x1)}, {s8_const_lit("x1"), &type__f32, .offset = offsetof(r1f32_t, x1)},
}; };
global DEFINE_STRUCT(r1f32_t); gb_read_only DEFINE_STRUCT(r1f32_t);
global type_t type__v2f64_t = { type_kind_struct, s8_const_lit("v2f64_t"), sizeof(v2f64_t), .count = 2, gb_read_only type_t type__v2f64_t = { type_kind_struct, s8_const_lit("v2f64_t"), sizeof(v2f64_t), .count = 2,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("x"), &type__f64, .offset = offsetof(v2f64_t, x)}, {s8_const_lit("x"), &type__f64, .offset = offsetof(v2f64_t, x)},
{s8_const_lit("y"), &type__f64, .offset = offsetof(v2f64_t, y)}, {s8_const_lit("y"), &type__f64, .offset = offsetof(v2f64_t, y)},
} }
}; };
global type_t type__v3f64_t = { type_kind_struct, s8_const_lit("v3f64_t"), sizeof(v3f64_t), .count = 3, gb_read_only type_t type__v3f64_t = { type_kind_struct, s8_const_lit("v3f64_t"), sizeof(v3f64_t), .count = 3,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("x"), &type__f64, .offset = offsetof(v3f64_t, x)}, {s8_const_lit("x"), &type__f64, .offset = offsetof(v3f64_t, x)},
{s8_const_lit("y"), &type__f64, .offset = offsetof(v3f64_t, y)}, {s8_const_lit("y"), &type__f64, .offset = offsetof(v3f64_t, y)},
@@ -191,7 +191,7 @@ global type_t type__v3f64_t = { type_kind_struct, s8_const_lit("v3f64_t"), sizeo
} }
}; };
global type_t type__v4f64_t = { type_kind_struct, s8_const_lit("v4f64_t"), sizeof(v4f64_t), .count = 4, gb_read_only type_t type__v4f64_t = { type_kind_struct, s8_const_lit("v4f64_t"), sizeof(v4f64_t), .count = 4,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("x"), &type__f64, .offset = offsetof(v4f64_t, x)}, {s8_const_lit("x"), &type__f64, .offset = offsetof(v4f64_t, x)},
{s8_const_lit("y"), &type__f64, .offset = offsetof(v4f64_t, y)}, {s8_const_lit("y"), &type__f64, .offset = offsetof(v4f64_t, y)},
@@ -200,7 +200,7 @@ global type_t type__v4f64_t = { type_kind_struct, s8_const_lit("v4f64_t"), sizeo
} }
}; };
global type_t type__r3f64_t = { type_kind_struct, s8_const_lit("r3f64_t"), sizeof(r3f64_t), .count = 6, gb_read_only type_t type__r3f64_t = { type_kind_struct, s8_const_lit("r3f64_t"), sizeof(r3f64_t), .count = 6,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("x0"), &type__f64, .offset = offsetof(r3f64_t, x0)}, {s8_const_lit("x0"), &type__f64, .offset = offsetof(r3f64_t, x0)},
{s8_const_lit("y0"), &type__f64, .offset = offsetof(r3f64_t, y0)}, {s8_const_lit("y0"), &type__f64, .offset = offsetof(r3f64_t, y0)},
@@ -211,28 +211,28 @@ global type_t type__r3f64_t = { type_kind_struct, s8_const_lit("r3f64_t"), sizeo
} }
}; };
global type_member_t members__r2f64_t[] = { gb_read_only type_member_t members__r2f64_t[] = {
{s8_const_lit("x0"), &type__f64, .offset = offsetof(r2f64_t, x0)}, {s8_const_lit("x0"), &type__f64, .offset = offsetof(r2f64_t, x0)},
{s8_const_lit("y0"), &type__f64, .offset = offsetof(r2f64_t, y0)}, {s8_const_lit("y0"), &type__f64, .offset = offsetof(r2f64_t, y0)},
{s8_const_lit("x1"), &type__f64, .offset = offsetof(r2f64_t, x1)}, {s8_const_lit("x1"), &type__f64, .offset = offsetof(r2f64_t, x1)},
{s8_const_lit("y1"), &type__f64, .offset = offsetof(r2f64_t, y1)}, {s8_const_lit("y1"), &type__f64, .offset = offsetof(r2f64_t, y1)},
}; };
global DEFINE_STRUCT(r2f64_t); gb_read_only DEFINE_STRUCT(r2f64_t);
global type_member_t members__r1f64_t[] = { gb_read_only type_member_t members__r1f64_t[] = {
{s8_const_lit("x0"), &type__f64, .offset = offsetof(r1f64_t, x0)}, {s8_const_lit("x0"), &type__f64, .offset = offsetof(r1f64_t, x0)},
{s8_const_lit("x1"), &type__f64, .offset = offsetof(r1f64_t, x1)}, {s8_const_lit("x1"), &type__f64, .offset = offsetof(r1f64_t, x1)},
}; };
global DEFINE_STRUCT(r1f64_t); gb_read_only DEFINE_STRUCT(r1f64_t);
global type_t type__v2i32_t = { type_kind_struct, s8_const_lit("v2i32_t"), sizeof(v2i32_t), .count = 2, gb_read_only type_t type__v2i32_t = { type_kind_struct, s8_const_lit("v2i32_t"), sizeof(v2i32_t), .count = 2,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("x"), &type__i32, .offset = offsetof(v2i32_t, x)}, {s8_const_lit("x"), &type__i32, .offset = offsetof(v2i32_t, x)},
{s8_const_lit("y"), &type__i32, .offset = offsetof(v2i32_t, y)}, {s8_const_lit("y"), &type__i32, .offset = offsetof(v2i32_t, y)},
} }
}; };
global type_t type__v3i32_t = { type_kind_struct, s8_const_lit("v3i32_t"), sizeof(v3i32_t), .count = 3, gb_read_only type_t type__v3i32_t = { type_kind_struct, s8_const_lit("v3i32_t"), sizeof(v3i32_t), .count = 3,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("x"), &type__i32, .offset = offsetof(v3i32_t, x)}, {s8_const_lit("x"), &type__i32, .offset = offsetof(v3i32_t, x)},
{s8_const_lit("y"), &type__i32, .offset = offsetof(v3i32_t, y)}, {s8_const_lit("y"), &type__i32, .offset = offsetof(v3i32_t, y)},
@@ -240,7 +240,7 @@ global type_t type__v3i32_t = { type_kind_struct, s8_const_lit("v3i32_t"), sizeo
} }
}; };
global type_t type__v4i32_t = { type_kind_struct, s8_const_lit("v4i32_t"), sizeof(v4i32_t), .count = 4, gb_read_only type_t type__v4i32_t = { type_kind_struct, s8_const_lit("v4i32_t"), sizeof(v4i32_t), .count = 4,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("x"), &type__i32, .offset = offsetof(v4i32_t, x)}, {s8_const_lit("x"), &type__i32, .offset = offsetof(v4i32_t, x)},
{s8_const_lit("y"), &type__i32, .offset = offsetof(v4i32_t, y)}, {s8_const_lit("y"), &type__i32, .offset = offsetof(v4i32_t, y)},
@@ -249,7 +249,7 @@ global type_t type__v4i32_t = { type_kind_struct, s8_const_lit("v4i32_t"), sizeo
} }
}; };
global type_t type__r3i32_t = { type_kind_struct, s8_const_lit("r3i32_t"), sizeof(r3i32_t), .count = 6, gb_read_only type_t type__r3i32_t = { type_kind_struct, s8_const_lit("r3i32_t"), sizeof(r3i32_t), .count = 6,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("x0"), &type__i32, .offset = offsetof(r3i32_t, x0)}, {s8_const_lit("x0"), &type__i32, .offset = offsetof(r3i32_t, x0)},
{s8_const_lit("y0"), &type__i32, .offset = offsetof(r3i32_t, y0)}, {s8_const_lit("y0"), &type__i32, .offset = offsetof(r3i32_t, y0)},
@@ -260,29 +260,29 @@ global type_t type__r3i32_t = { type_kind_struct, s8_const_lit("r3i32_t"), sizeo
} }
}; };
global type_member_t members__r2i32_t[] = { gb_read_only type_member_t members__r2i32_t[] = {
{s8_const_lit("x0"), &type__i32, .offset = offsetof(r2i32_t, x0)}, {s8_const_lit("x0"), &type__i32, .offset = offsetof(r2i32_t, x0)},
{s8_const_lit("y0"), &type__i32, .offset = offsetof(r2i32_t, y0)}, {s8_const_lit("y0"), &type__i32, .offset = offsetof(r2i32_t, y0)},
{s8_const_lit("x1"), &type__i32, .offset = offsetof(r2i32_t, x1)}, {s8_const_lit("x1"), &type__i32, .offset = offsetof(r2i32_t, x1)},
{s8_const_lit("y1"), &type__i32, .offset = offsetof(r2i32_t, y1)}, {s8_const_lit("y1"), &type__i32, .offset = offsetof(r2i32_t, y1)},
}; };
global DEFINE_STRUCT(r2i32_t); gb_read_only DEFINE_STRUCT(r2i32_t);
global type_member_t members__r1i32_t[] = { gb_read_only type_member_t members__r1i32_t[] = {
{s8_const_lit("x0"), &type__i32, .offset = offsetof(r1i32_t, x0)}, {s8_const_lit("x0"), &type__i32, .offset = offsetof(r1i32_t, x0)},
{s8_const_lit("x1"), &type__i32, .offset = offsetof(r1i32_t, x1)}, {s8_const_lit("x1"), &type__i32, .offset = offsetof(r1i32_t, x1)},
}; };
global DEFINE_STRUCT(r1i32_t); gb_read_only DEFINE_STRUCT(r1i32_t);
global type_t type__v2i64_t = { type_kind_struct, s8_const_lit("v2i64_t"), sizeof(v2i64_t), .count = 2, gb_read_only type_t type__v2i64_t = { type_kind_struct, s8_const_lit("v2i64_t"), sizeof(v2i64_t), .count = 2,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("x"), &type__i64, .offset = offsetof(v2i64_t, x)}, {s8_const_lit("x"), &type__i64, .offset = offsetof(v2i64_t, x)},
{s8_const_lit("y"), &type__i64, .offset = offsetof(v2i64_t, y)}, {s8_const_lit("y"), &type__i64, .offset = offsetof(v2i64_t, y)},
} }
}; };
global type_t type__v3i64_t = { type_kind_struct, s8_const_lit("v3i64_t"), sizeof(v3i64_t), .count = 3, gb_read_only type_t type__v3i64_t = { type_kind_struct, s8_const_lit("v3i64_t"), sizeof(v3i64_t), .count = 3,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("x"), &type__i64, .offset = offsetof(v3i64_t, x)}, {s8_const_lit("x"), &type__i64, .offset = offsetof(v3i64_t, x)},
{s8_const_lit("y"), &type__i64, .offset = offsetof(v3i64_t, y)}, {s8_const_lit("y"), &type__i64, .offset = offsetof(v3i64_t, y)},
@@ -290,7 +290,7 @@ global type_t type__v3i64_t = { type_kind_struct, s8_const_lit("v3i64_t"), sizeo
} }
}; };
global type_t type__v4i64_t = { type_kind_struct, s8_const_lit("v4i64_t"), sizeof(v4i64_t), .count = 4, gb_read_only type_t type__v4i64_t = { type_kind_struct, s8_const_lit("v4i64_t"), sizeof(v4i64_t), .count = 4,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("x"), &type__i64, .offset = offsetof(v4i64_t, x)}, {s8_const_lit("x"), &type__i64, .offset = offsetof(v4i64_t, x)},
{s8_const_lit("y"), &type__i64, .offset = offsetof(v4i64_t, y)}, {s8_const_lit("y"), &type__i64, .offset = offsetof(v4i64_t, y)},
@@ -299,7 +299,7 @@ global type_t type__v4i64_t = { type_kind_struct, s8_const_lit("v4i64_t"), sizeo
} }
}; };
global type_t type__r3i64_t = { type_kind_struct, s8_const_lit("r3i64_t"), sizeof(r3i64_t), .count = 6, gb_read_only type_t type__r3i64_t = { type_kind_struct, s8_const_lit("r3i64_t"), sizeof(r3i64_t), .count = 6,
.members = (type_member_t[]){ .members = (type_member_t[]){
{s8_const_lit("x0"), &type__i64, .offset = offsetof(r3i64_t, x0)}, {s8_const_lit("x0"), &type__i64, .offset = offsetof(r3i64_t, x0)},
{s8_const_lit("y0"), &type__i64, .offset = offsetof(r3i64_t, y0)}, {s8_const_lit("y0"), &type__i64, .offset = offsetof(r3i64_t, y0)},
@@ -310,35 +310,35 @@ global type_t type__r3i64_t = { type_kind_struct, s8_const_lit("r3i64_t"), sizeo
} }
}; };
global type_member_t members__r2i64_t[] = { gb_read_only type_member_t members__r2i64_t[] = {
{s8_const_lit("x0"), &type__i64, .offset = offsetof(r2i64_t, x0)}, {s8_const_lit("x0"), &type__i64, .offset = offsetof(r2i64_t, x0)},
{s8_const_lit("y0"), &type__i64, .offset = offsetof(r2i64_t, y0)}, {s8_const_lit("y0"), &type__i64, .offset = offsetof(r2i64_t, y0)},
{s8_const_lit("x1"), &type__i64, .offset = offsetof(r2i64_t, x1)}, {s8_const_lit("x1"), &type__i64, .offset = offsetof(r2i64_t, x1)},
{s8_const_lit("y1"), &type__i64, .offset = offsetof(r2i64_t, y1)}, {s8_const_lit("y1"), &type__i64, .offset = offsetof(r2i64_t, y1)},
}; };
global DEFINE_STRUCT(r2i64_t); gb_read_only DEFINE_STRUCT(r2i64_t);
global type_member_t members__r1i64_t[] = { gb_read_only type_member_t members__r1i64_t[] = {
{s8_const_lit("x0"), &type__i64, .offset = offsetof(r1i64_t, x0)}, {s8_const_lit("x0"), &type__i64, .offset = offsetof(r1i64_t, x0)},
{s8_const_lit("x1"), &type__i64, .offset = offsetof(r1i64_t, x1)}, {s8_const_lit("x1"), &type__i64, .offset = offsetof(r1i64_t, x1)},
}; };
global DEFINE_STRUCT(r1i64_t); gb_read_only DEFINE_STRUCT(r1i64_t);
global type_member_t members__lex_kind_t[] = { gb_read_only type_member_t members__lex_kind_t[] = {
#define X(KIND, STR, SIMPLE) {.name = s8_const_lit("lex_kind_" #KIND), .value = lex_kind_##KIND}, #define X(KIND, STR, SIMPLE) {.name = s8_const_lit("lex_kind_" #KIND), .value = KIND},
LEX_KIND_XLIST LEX_KIND_XLIST
#undef X #undef X
}; };
DEFINE_ENUM(lex_kind_t); DEFINE_ENUM(lex_kind_t);
global type_member_t members__lex_suffix_t[] = { gb_read_only type_member_t members__lex_suffix_t[] = {
#define X(KIND) {.name = s8_const_lit("lex_suffix_" #KIND), .value = lex_suffix_##KIND}, #define X(KIND) {.name = s8_const_lit(#KIND), .value = KIND},
LEX_SUFFIX_XLIST LEX_SUFFIX_XLIST
#undef X #undef X
}; };
DEFINE_ENUM(lex_suffix_t); DEFINE_ENUM(lex_suffix_t);
global type_member_t members__log_level_t[] = { gb_read_only type_member_t members__log_level_t[] = {
{.name = s8_const_lit("log_level_debug"), .value = log_level_debug}, {.name = s8_const_lit("log_level_debug"), .value = log_level_debug},
{.name = s8_const_lit("log_level_info"), .value = log_level_info}, {.name = s8_const_lit("log_level_info"), .value = log_level_info},
{.name = s8_const_lit("log_level_warning"), .value = log_level_warning}, {.name = s8_const_lit("log_level_warning"), .value = log_level_warning},

View File

@@ -5,8 +5,7 @@ fn_wasm_import f64 wasm_measure_text(isize str, i32 len, isize font_str, i32 fo
fn_wasm_import f64 wasm_get_font_height(isize font_str, i32 font_len, i32 font_size); fn_wasm_import f64 wasm_get_font_height(isize font_str, i32 font_len, i32 font_size);
fn_wasm_import void wasm_set_clip(f64 x, f64 y, f64 w, f64 h); fn_wasm_import void wasm_set_clip(f64 x, f64 y, f64 w, f64 h);
global s8_t font_face = s8_const_lit("open_sans_regular"); gb_read_only s8_t font_face = s8_const_lit("open_sans_regular");
fn void set_clip(r2f64_t rect) { fn void set_clip(r2f64_t rect) {
wasm_set_clip(wasm_dpr * rect.min.x, wasm_dpr * rect.min.y, wasm_dpr * (rect.max.x - rect.min.x), wasm_dpr * (rect.max.y - rect.min.y)); wasm_set_clip(wasm_dpr * rect.min.x, wasm_dpr * rect.min.y, wasm_dpr * (rect.max.x - rect.min.x), wasm_dpr * (rect.max.y - rect.min.y));