Author Topic: #define preprocessor macro bug  (Read 2414 times)

Offline SasMaster

  • Single posting newcomer
  • *
  • Posts: 3
#define preprocessor macro bug
« on: November 22, 2015, 01:49:29 pm »
Hi All.I wonder what's the problem with preprocessor definitions inside  Build Options - > #defines . I was using a version 12.x on Ubuntu and no matter what I defined there it wasn't getting activated inside the ide.I then updated to the latest version and it is still there.Is it a bug?Is anyone aware of it?

Thanks.

Offline cacb

  • Regular
  • ***
  • Posts: 389
Re: #define preprocessor macro bug
« Reply #1 on: November 22, 2015, 02:49:42 pm »
I use that feature on Windows and Linux and it works the way I expect it to work. Maybe you have more specific information on the problem you are seeing?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6546
    • My Best Post
Re: #define preprocessor macro bug
« Reply #2 on: November 22, 2015, 05:59:42 pm »
FYI: If you are using a custom makefile project then the defines do NOT effect the makefile.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline SasMaster

  • Single posting newcomer
  • *
  • Posts: 3
Re: #define preprocessor macro bug
« Reply #3 on: November 24, 2015, 02:56:50 pm »
Nope,I am just putting my defines into "#defines" dialog.But they are not reflected in the editor.The compiler "sees" them as the compilations proceeds according to the flags.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2370
Re: #define preprocessor macro bug
« Reply #4 on: November 24, 2015, 03:01:03 pm »
are you talking about editor or compilation?

They are not reflected in the code coloring in the editor, because the editor uses the code highlighting from scintilla and this component has (yet, patches are welcome) no information about the build settings.
If you are talking about compilation i would suggest that you post a full rebuild log here, so we can see what is going on...

greetings

Offline SasMaster

  • Single posting newcomer
  • *
  • Posts: 3
Re: #define preprocessor macro bug
« Reply #5 on: November 24, 2015, 04:51:09 pm »
I am talking about the editor.The compilation is completely all right.So you say that the editor doesn't support active macro blocks color?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2370
Re: #define preprocessor macro bug
« Reply #6 on: November 24, 2015, 06:25:05 pm »
I have to take back my comment. I looked into the code, and there is a working function, that collects the defines from the project file and updates the code highlighting. And it is also working for me. But i had to switch to a other target and then back to trigger the update mechanism (It gets triggered on "activate target" "activate project" and "loading workspace complete" events")

what version are you using? Have you tried a nightly build (remember 13.12 is nearly 2 years old)? If you can't try a nightly, i think in December will be the next release (see http://forums.codeblocks.org/index.php/topic,20730.msg141268/topicseen.html#msg141268)

greetings