User forums > Using Code::Blocks

Wrong inactive preprocessor code

(1/1)

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
--- Code: ---#define NNUELEARN
--- End code ---
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

--- End code ---

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

Navigation

[0] Message Index

Go to full version