News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Wrong inactive preprocessor code

Started by RubiChess, March 25, 2021, 02:13:42 PM

Previous topic - Next topic

RubiChess

Hi.

I'm new Code::Blocks user and new here and this is my first question:

1. I have a C++ header file RubiChess.h which is included in the projects Header files and has some #define NNUELEARN
2. I have a C++ source file learn.cpp which includes this header file in the very first line and after that checks the define

#include "RubiChess.h"

#ifdef NNUELEARN
//
// my code
//
#endif


The editor greys out all the code inside the #ifdef NNUELEARN area although Settings/Editor/C++ Editor settings has "interpret #if..." and "Collect defines from project files" enabled. So I would expect the editor only grey out the code when I disable the #define NNUELEARN in the header file. This at least is how MSVC does it.

Seems that the editor doesn't look into the header file at all.
Bug? Or do I miss something?

Regards, Andreas