Supermacros
#1

Hi! I'm using Zeex's compiler, and I'm trying to create a "supermacro" of sorts:
main.pwn
pawn Код:
#include "macro"
#include "macro"
macro.inc
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
But it includes both "versions" at once. I debugged it with:

main.pwn
pawn Код:
#include "macro"
macro.inc
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
It errors out even when included only once.
Any idea how to approach this?
Reply


Messages In This Thread
Supermacros - by Misiur - 24.08.2017, 01:37
Re: Supermacros - by azzerking - 24.08.2017, 01:54
Re: Supermacros - by Misiur - 24.08.2017, 01:59
Re: Supermacros - by azzerking - 24.08.2017, 02:28
Re: Supermacros - by Paulice - 24.08.2017, 02:37
Re: Supermacros - by azzerking - 24.08.2017, 02:44
Re: Supermacros - by Misiur - 24.08.2017, 02:49
Re: Supermacros - by azzerking - 24.08.2017, 02:56

Forum Jump:


Users browsing this thread: 2 Guest(s)