Today I learned (or figured out) how to write a fully generic parameters passing library, so you can FINALLY do this:
PHP код:
#include <a_samp>
#include <YSI_Coding\y_va2>
main()
{
MyFunc1("Hello", "there", "world");
}
MyFunc1(...)
{
MyFunc2(___);
}
MyFunc2(...)
{
printf("%s %s %s", ___);
}
That triple underscore (chosen as it mirrors the triple dots and the single underscore used to set parameters to their defaults, an obscure piece of syntax) will correctly forward ALL the given parameters on to the next parameter without any extra effort required on the part of the function writer. This totally replaces y_va and other solutions that did complex things like totally wrapping certain functions or other complex assembly solutions.
In short, "___" calls a function that takes all the paramters from the parent function and duplicates them on the stack - it is actually quite simple in retrospect. There are some tricky bits to get right to support recursive calls, and nested calls like:
PHP код:
Func1(Func2(___), ___);
But I know how to solve these.