[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

error g++ 4 and friend class

From: address@hidden
Subject: error g++ 4 and friend class
Date: Tue, 23 Feb 2010 13:43:38 -0800 (PST)
User-agent: G2/1.0

Hello, I have a big problem porting a huge c++ application on MacOS X
and g++ 4
here is my problem:
I have a code look like that in a header:


class NOMCLASS {
... //some code
friend class MACRO1(TOTO); //MACRO is a macro define somewhere
friend class MACRO1(TATA);



unfortunately, there is sometime where MACRO1(TOTO) is replaces by
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 change the code, it's huge and
occur many time. but i try to find some trick 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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]