Hello all.
I've made the following code, which is in my include:
PHP Code:
#define calculateArray(%1,%2) _calculateArray(%1,%2,sizeof %1)
stock _calculateArray(array[], num, size)
{
//some unimportant stuff here
}
Since I can't access directly to the sizeof function inside my include file (and I don't want to manually pass the parameter), I've created a macro that will automatically do that for me.
My problem is that it works fine when I use it like this:
PHP Code:
new array[6];
calculateArray(array, 3);
But I get an error when I try to use it like this:
PHP Code:
new array[4][6];
calculateArray(array[0], 3);
Code:
WARNING [273]: expression has no effect
ERROR [273]: expected token: "]", but found "-integer value-"
ERROR [273]: expected token: ";", but found "]"
ERROR [273]: invalid expression, assumed zero
I think that the macro passed "sizeof array[0]" thus making an error. Some workaround for this?
Thanks in advance.