Another solution provided by ChatGPT, currently no issues have been identified
Additionally, (I don't want to generate a DLL) how to release C code resources in memory in QM, just like UnloadDll....
Macro Tcc2
Additionally, (I don't want to generate a DLL) how to release C code resources in memory in QM, just like UnloadDll....
Macro Tcc2
dll- "" $str_add $a $b
int compileOnce
;int compileOnce=32
__Tcc+ t
if !t.f or !compileOnce
,t.Compile("" "add" 0|compileOnce)
,&str_add=t.f
out str_add("hello" " world!")
#ret
char* add(char* a, char* b)
{
,printf("%s: a=%s, b=%s", __func__, a, b);
,char* result = malloc(strlen(a) + strlen(b) + 1);
,strcpy(result, a);
,strcat(result, b);
,return result;
}