Fancy defines
#2

Run pawncc with -l to find out. Those macros are broken though:
pawn Код:
main() {
    printf("%i", onConnect(42));
}

onConnect(ha_lol)
{

    return ha_lol::ha.hi(6);
}
#e:
Ok, I've found the problem - and it's quite tricky (and I've learned cool things from this).

The code:
pawn Код:
#include <a_samp>

#define ha::%0::%1.%2(%3) (2*%3)
#define lol:%0) ha_%0)

main() {
    printf("%i", onConnect(42));
}

onConnect(lol:lol)
{
    return ha::lol::ha.hi(6); // line 12
}
http://forum.sa-mp.com/showthread.ph...175#post785175 In that tutorial you can find out how macros are built and stuff, but there is one little error - % is a valid character in macro definition, and you need invalid character to start 2 part of macro.
pawn Код:
#define ha_%0) bar_%0
won't work, because _ is legal character. You have to change _ to some illegal char, like : to make it work.

#e2:
My explanation isn't valid, but results are
Reply


Messages In This Thread
Fancy defines - by theYiin - 11.08.2013, 10:14
Re: Fancy defines - by Misiur - 11.08.2013, 10:20

Forum Jump:


Users browsing this thread: 1 Guest(s)