in reply to nested #if directive matching matching

prassi:

Since 1 is true, I'd expect to get exactly what you're getting. If you change it to "#if 0" do you get what you were wanting?

Update: The quick hack I mentioned previously used the stack (as does tonyink's reply). It mostly wanted a way to handle #include files for getting the definitions of other #defines & such.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^2: nested #if directive matching matching
by prassi (Acolyte) on Jun 26, 2012 at 12:49 UTC
    Hi Roboticus,

    In my actual code of .h file I am interested to extract only those #define which are out of any directive statement, so it is either #if 1 or #if 0 it has to be ignored. Yes even "#if 0" the code works

    Regards, -Prassi