24.08.2017, 01:37
Hi! I'm using Zeex's compiler, and I'm trying to create a "supermacro" of sorts:
main.pwn
macro.inc
But it includes both "versions" at once. I debugged it with:
main.pwn
macro.inc
It errors out even when included only once.
Any idea how to approach this?
main.pwn
pawn Код:
#include "macro"
#include "macro"
pawn Код:
#if defined MACRO_END
#endinput
#endif
#if !defined MACRO_HEADER
#define MACRO_HEADER
print("Hello 1!");
#endinput
#endif
print("Hello 2!");
#define MACRO_END
main.pwn
pawn Код:
#include "macro"
pawn Код:
#if defined MACRO_END
#endinput
#endif
#if !defined MACRO_HEADER
#define MACRO_HEADER
print("Hello 1!");
#endinput
#endif
#error But I only included it once :(
#define MACRO_END
Any idea how to approach this?