Skip to content
Snippets Groups Projects
Commit 4a71f1bd authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Now creates code that uses ADD_FUNCTION2().

Rev: bin/precompile.pike:1.15
parent 9c28efd1
No related branches found
No related tags found
No related merge requests found
...@@ -472,21 +472,36 @@ array convert(array x, string base) ...@@ -472,21 +472,36 @@ array convert(array x, string base)
}); });
addfuncs+=({ if (attributes->efun) {
sprintf("\n#ifdef f_%s_defined\n",name), addfuncs+=({
PC.Token(sprintf(" %s(%O,f_%s,tFunc(%s,%s),%s);\n", sprintf("\n#ifdef f_%s_defined\n",name),
attributes->efun ? "ADD_EFUN" : "ADD_FUNCTION", PC.Token(sprintf(" ADD_EFUN(%O, f_%s, tFunc(%s, %s), %s);\n",
attributes->name || name, attributes->name || name,
name, name,
attributes->type ? attributes->type : attributes->type ? attributes->type :
Array.map(args->type,convert_type)*" ", Array.map(args->type,convert_type)*" ",
convert_type(rettype), convert_type(rettype),
(attributes->efun ? attributes->optflags : (attributes->efun ? attributes->optflags :
attributes->flags )|| "0" , attributes->flags )|| "0" ,
),proto[0]->line), ),proto[0]->line),
sprintf("#endif\n",name), sprintf("#endif\n",name),
}); });
} else {
addfuncs+=({
sprintf("\n#ifdef f_%s_defined\n",name),
PC.Token(sprintf(" ADD_FUNCTION2(%O, f_%s, tFunc(%s, %s), %s, %s);\n",
attributes->name || name,
name,
attributes->type ? attributes->type :
Array.map(args->type,convert_type)*" ",
convert_type(rettype),
attributes->flags || "0" ,
attributes->optflags ||
"OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT"
),proto[0]->line),
sprintf("#endif\n",name),
});
}
int argnum; int argnum;
argnum=0; argnum=0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment