diff --git a/base/components/inlines.hpp b/base/components/inlines.hpp index ba4036a..7843ea1 100644 --- a/base/components/inlines.hpp +++ b/base/components/inlines.hpp @@ -484,7 +484,7 @@ void class_add_interface( CodeClass self, CodeTypename type ) possible_slot = cast(CodeTypename, possible_slot->Next); } - possible_slot->Next = type; + possible_slot->Next = cast(Code, type); } #pragma endregion CodeClass @@ -700,10 +700,10 @@ void struct_add_interface(CodeStruct self, CodeTypename type ) while ( possible_slot->Next != nullptr ) { - possible_slot->Next = cast(CodeTypename, possible_slot->Next); + possible_slot = cast(CodeTypename, possible_slot->Next); } - possible_slot->Next = type; + possible_slot->Next = cast(Code, type); } #pragma endregion Code diff --git a/gen_c_library/c_library.cpp b/gen_c_library/c_library.cpp index ccda153..4407cef 100644 --- a/gen_c_library/c_library.cpp +++ b/gen_c_library/c_library.cpp @@ -1882,6 +1882,9 @@ R"(#define ( code ) _Generic( (code), \ header.print( r_header_macros ); header.print( header_generic_macros ); + + header.print_fmt( "\nGEN_API_C_BEGIN\n" ); + header.print( r_header_basic_types ); header.print( r_header_debug ); header.print( rf_header_memory ); @@ -1895,6 +1898,7 @@ R"(#define ( code ) _Generic( (code), \ header.print( r_header_timing ); header.print(rf_header_parsing ); + header.print_fmt( "\nGEN_API_C_END\n" ); header.print_fmt( "\nGEN_NS_END\n" ); header.write(); } @@ -1949,6 +1953,15 @@ R"(#define ( code ) _Generic( (code), \ header.print( rf_ast_types ); header.print_fmt("\n#pragma endregion AST\n"); + header.print( fmt_newline); + header.print( rf_array_arena ); + header.print( fmt_newline); + header.print( rf_array_pool); + header.print( fmt_newline); + header.print( rf_array_string_cached ); + header.print( fmt_newline); + header.print( rf_ht_preprocessor_macro ); + header.print( rf_interface ); header.print( rf_constants ); header.print(fmt_newline); @@ -1958,7 +1971,6 @@ R"(#define ( code ) _Generic( (code), \ header.print_fmt("#pragma endregion Inlines\n"); header.print(fmt_newline); - header.print( rf_array_string_cached ); header.print( rf_header_builder ); header.print( rf_header_scanner ); @@ -1976,11 +1988,6 @@ R"(#define ( code ) _Generic( (code), \ builder_print( src, src_start ); src.print_fmt( "\nGEN_NS_BEGIN\n"); - src.print( fmt_newline); - src.print( rf_array_arena ); - src.print( fmt_newline); - src.print( rf_array_pool); - src.print( r_src_static_data ); src.print( fmt_newline);