SA-MP Forums Archive
Create define using macro - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Create define using macro (/showthread.php?tid=446280)



Create define using macro - zgintasz - 25.06.2013

Is there any compiler hack to create a define using macro? For example:
Код:
#define example \
	#define anotherexample 1
now gives warning redefinition of constant/macro (symbol "example")


Re: Create define using macro - iJumbo - 25.06.2013

What do you mean?
Define something in a macro?


Re: Create define using macro - zgintasz - 25.06.2013

Quote:
Originally Posted by iJumbo
Посмотреть сообщение
What do you mean?
Define something in a macro?
I already wrote what I mean.
Yes, define something using macro.


Re: Create define using macro - iJumbo - 25.06.2013

I think you are going to define #define example to #define anotherexample 1 so no that no have so much sense.
What do you want to do with that definition? maybe another way to do it


Re: Create define using macro - zgintasz - 25.06.2013

No other way, there was just a quick example and I need only that way.


Re: Create define using macro - iJumbo - 25.06.2013

Yea but why you have to define a definition that no have sense


Re: Create define using macro - zgintasz - 25.06.2013

Who cares if that makes sense, I just want to know. If you can't help, then don't post.


Re: Create define using macro - iJumbo - 25.06.2013

I already say that you can't do that.

But i want to know why you have to do that for help you maybe make a better code


Re: Create define using macro - Pupak - 25.06.2013

Definitions are processed in pawn pre-processor, so no, you can't do it, and there is no reason why you would want to do that.


Re: Create define using macro - zgintasz - 26.06.2013

Okay, thanks.