Quote:
Originally Posted by Dayvison_
What happens with the pre-compiler, why the first seven characters are ignored? why this not give a warning unknown #pragma. you confused me
|
No clue - you aren't really meant to redefine pragmas, so I think the compiler is getting confused, processing the word "tabsize" (hence advancing the pointer 7 characters), then doing the replacement, then thinking there's a new symbol starting from that point on.
Quote:
Originally Posted by Paulice
PHP код:
#undef tabsize
#pragma tabsize 0
Hack right back at you! (tested)
-----
|
Well obviously. But I doubt anyone with the knowledge to do that will be using "tabsize 0" in the first place.
Quote:
Originally Posted by Paulice
What is "%00%0\10;%0" for?
PHP код:
#define tabsize _DUMMY_do_not_use_tabsize_0
works just as fine for me (Russian compiler)
|
Yes, but that will break ANY "tabsize" use, even good ones like "tabsize 4". The extra code checks that there is a "0" between the end of "tabsize" and the end of the line ("\10;"). So strictly speaking this will also ban "#pragma tabsize 10", but in many years I've never seen indentations other than 0, 1, 2, 3, 4, and 8 (and that's including all languages, not just pawn), so I think we're good.
Given that, you can also bypass it with:
PHP код:
#define ZERO 0
#pragma tabsize ZERO