Hello, I have a big problem porting a huge c++ application on MacOS X and gcc 4
here is my problem:
I have a code look like that in a header:
#if(defined(NOMCLASS))
class NOMCLASS {
... //some code
...
friend class MACRO1(TOTO); //MACRO is a macro define somewhere
friend class MACRO1(TATA);
}
#endif
unfortunately, there is sometime where MACRO1(TOTO) is replaces by the same name than NOMCLASS, fo exemple c_TOTO i have then:
class c_TOTO {
... //some code
...
friend class c_TOTO;
...
that was no problem under visual studio, but in that case, i have the following error: c_TOTO implicitly friends with itself.
how can I remove that error? I cannot touch that code, it's huge and occur many time. but i should have something like if NOMCLASS equal to MACRO1(TOTO); then don't compile the line friend class c_TOTO; but it's preprocessor token and macro i don't think i can "compare"...
anybody have idea to help me about that?
thanks in advance.
Well i don't know exactly, it is just a bit of a huge code i begin to read and port.
but the macro take the parameter and add prefix like that
c_toto, c_tata
i guess some classe name are variable and all the macro and #define are used to generate many kind of class...
anyway, this error is a big problem :-(
this code work with previous version of g++ and VS but with g++ 4 it makes that error (...implicitly friends with itself) if i cannot correct by code, if there any g++ flag i could use to keep compatibility?
thanks