Author Topic: Wrong inactive preprocessor code  (Read 3555 times)

RubiChess

  • Guest
Wrong inactive preprocessor code
« on: March 25, 2021, 02:13:42 pm »
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
Code
#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
Code
#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