Updates to gen_c_library docs

This commit is contained in:
2024-12-16 00:47:46 -05:00
parent e4f564b165
commit cb50f93af5
5 changed files with 129 additions and 40 deletions

View File

@ -1139,15 +1139,6 @@ R"(#define <interface_name>( code ) _Generic( (code), \
CodeFn fn = cast(CodeFn, entry);
Code prev = entry->Prev;
#if 0
if (prev && prev->Name.is_equal(entry->Name)) {
// rename second definition so there isn't a symbol conflict
StrBuilder postfix_arr = StrBuilder::fmt_buf(_ctx->Allocator_Temp, "%S_arr", entry->Name);
entry->Name = cache_str(postfix_arr.to_str());
postfix_arr.free();
}
#endif
b32 handled= false;
for ( CodeParams opt_param : fn->Params ) if (opt_param->ValueType->Name.starts_with(txt("Opts_")))
{
@ -1373,17 +1364,6 @@ R"(#define <interface_name>( code ) _Generic( (code), \
{
CodeFn fn = cast(CodeFn, entry);
Code prev = entry->Prev;
#if 0
for ( CodeParams arr_param : fn->Params )
{
b32 repeat_register_macros = fn->Name.is_equal(txt("register_macros")) && arr_param->Name.is_equal(txt("num")) && ! arr_param->Next->Name.is_equal(txt("..."));
if ( repeat_register_macros ) {
// rename second definition so there isn't a symbol conflict
StrBuilder postfix_arr = StrBuilder::fmt_buf(_ctx->Allocator_Temp, "%S_arr", fn->Name);
fn->Name = cache_str(postfix_arr.to_str());
}
}
#endif
src_interface.append(fn);
}
break;
@ -1450,18 +1430,6 @@ R"(#define <interface_name>( code ) _Generic( (code), \
{
CodeFn fn = cast(CodeFn, entry);
Code prev = entry->Prev;
#if 0
for ( CodeParams arr_param : fn->Params )
{
b32 repeat_def_array = fn->Name.starts_with(txt("def_")) && arr_param->Name.is_equal(txt("num")) && ! arr_param->Next->Name.is_equal(txt("..."));
if ( repeat_def_array ) {
// rename second definition so there isn't a symbol conflict
StrBuilder postfix_arr = StrBuilder::fmt_buf(_ctx->Allocator_Temp, "%S_arr", fn->Name);
fn->Name = cache_str(postfix_arr.to_str());
}
}
#endif
for ( CodeParams opt_param : fn->Params ) if (opt_param->ValueType->Name.starts_with(txt("Opts_")))
{
// The frontend names are warapped in macros so we need to give it the intenral symbol name