fixing post-gen c-library compiler errors (still quite a few togo

This commit is contained in:
Edward R. Gonzalez 2024-12-15 01:55:22 -05:00
parent 4fe1a4da65
commit 7946954017
2 changed files with 4 additions and 3 deletions

View File

@ -250,7 +250,7 @@ void define_to_strbuilder_ref(CodeDefine define, StrBuilder* result )
{ {
GEN_ASSERT(define); GEN_ASSERT(define);
GEN_ASSERT(define->Body); GEN_ASSERT(define->Body);
GEN_ASSERT(define->Body->Content); GEN_ASSERT(define->Body->Content.Ptr && define->Body->Content.Len > 0);
if (define->Params) { if (define->Params) {
StrBuilder params_builder = define_params_to_strbuilder(define->Params); StrBuilder params_builder = define_params_to_strbuilder(define->Params);
strbuilder_append_fmt( result, "#define %S(%S) %S", define->Name, strbuilder_to_str(params_builder), define->Body->Content ); strbuilder_append_fmt( result, "#define %S(%S) %S", define->Name, strbuilder_to_str(params_builder), define->Body->Content );

View File

@ -1327,9 +1327,9 @@ CodeDefine parser_parse_define()
params = (CodeDefineParams) make_code(); params = (CodeDefineParams) make_code();
params->Type = CT_Parameters_Define; params->Type = CT_Parameters_Define;
params->Name = currtok.Text; params->Name = currtok.Text;
params->NumEntries ++;
define->Params = params; define->Params = params;
eat( Tok_Preprocess_Define_Param ); eat( Tok_Preprocess_Define_Param );
// #define <Name> ( <param> // #define <Name> ( <param>
} }
@ -4964,12 +4964,13 @@ CodeTypedef parser_parse_typedef()
// valid_macro |= macro && macro_expects_body(* macro)); // valid_macro |= macro && macro_expects_body(* macro));
// } // }
Code macro;
if ( valid_macro ) if ( valid_macro )
#endif #endif
{ {
type = cast(Code, t_empty); type = cast(Code, t_empty);
Code macro = parse_simple_preprocess(currtok.Type);
name = currtok; name = currtok;
Code macro = parse_simple_preprocess(currtok.Type);
name.Text.Len = macro->Content.Len; name.Text.Len = macro->Content.Len;
_ctx->parser.Scope->Name = name.Text; _ctx->parser.Scope->Name = name.Text;
// <ModuleFalgs> typedef <Preprocessed_Macro> // <ModuleFalgs> typedef <Preprocessed_Macro>