Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
War Against macros
byo:
Hi,
There's problem when compiling on linux after last "War against macros" (rev 4018).
Before the change, compilers were selected for specific platform using #ifdef stuff, now it's using standard c++ if.
Now there are two problems: list of #includes is still masked using #ifdef, so when compmiling on linux it will need compiler interfaces like compilerMSVC. It's never used since if (platform::windows) filters it, but compiler have to know this class just to compile. Even after removing conditional includes the problem still remains because specific compilers are again internally filtered against unknown platforms inside their .h files just like this:
--- Code: ---#ifdef __WXMSW__
// this compiler is valid only in windows
#ifndef COMPILERMSVC_H
#define COMPILERMSVC_H
#include <compiler.h>
class CompilerMSVC : public Compiler
{
....
--- End code ---
Regards
BYO
MortenMacFly:
--- Quote from: byo on May 31, 2007, 11:23:01 am ---There's problem when compiling on linux after last "War against macros" (rev 4018).
Before the change, compilers were selected for specific platform using #ifdef stuff, now it's using standard c++ if. [...]
--- End quote ---
Right... this particular part should be reverted... Sorry. :oops:
With regards, Morten.
MortenMacFly:
BTW: You meant the CompilerFactory::RegisterCompiler stuff only, or are there any mote issues?
With regards, Morten.
byo:
--- Quote from: MortenMacFly on May 31, 2007, 11:29:29 am ---
--- Quote from: byo on May 31, 2007, 11:23:01 am ---There's problem when compiling on linux after last "War against macros" (rev 4018).
Before the change, compilers were selected for specific platform using #ifdef stuff, now it's using standard c++ if. [...]
--- End quote ---
Right... this particular part should be reverted... Sorry. :oops:
With regards, Morten.
--- End quote ---
Maybe not reverted :) It just need more #ifdef like macros to be removed, generally this apply to:
* #includes inside compilergcc.cpp - all compilers should be included no matter what platform
* All compilerXXX.cpp / compilerXXX.h files - stuff like #ifdef __WXMSW__ should also be removed
That will link code for compilers which are never used, but the overhead is not so big :)
Regards
BYO
MortenMacFly:
--- Quote from: byo on May 31, 2007, 01:03:36 pm ---Maybe not reverted :) It just need more #ifdef like macros to be removed, generally this apply to:
* #includes inside compilergcc.cpp - all compilers should be included no matter what platform
* All compilerXXX.cpp / compilerXXX.h files - stuff like #ifdef __WXMSW__ should also be removedThat will link code for compilers which are never used, but the overhead is not so big :)
--- End quote ---
I'd agree on that... sounds good to me. I'll give it a try to see if it would work. Hence I still have this Linux blindness - mind trying on Linux? (I mean it should work... but now I'm more carefully than last time... ;-)).
BTW: I tried to fix the compilation in SVN by now...
Navigation
[0] Message Index
[#] Next page
Go to full version