summaryrefslogtreecommitdiffstats
path: root/qmake/generators/makefile.h
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/generators/makefile.h')
-rw-r--r--qmake/generators/makefile.h34
1 files changed, 31 insertions, 3 deletions
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index 0b3bdfa..85510ea 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -249,9 +249,37 @@ public:
virtual bool openOutput(QFile &, const QString &build) const;
virtual bool isWindowsShell() const { return Option::target_mode == Option::TARG_WIN_MODE; }
- // This is to avoid having SymbianCommonGenerator as a virtually inherited class
- // of this class. Instead it is without a base class (avoiding the virtual
- // inheritance problem), and is allowed to use functions defined in here.
+ /* The next one is to avoid having SymbianCommonGenerator as a virtually
+ inherited class of this class. Instead it is without a base class
+ (avoiding the virtual inheritance problem), and is allowed to use
+ functions defined in here.
+
+ To illustrate:
+ +-------------------+
+ | MakefileGenerator |
+ +-------------------+
+ ^ ^
+ | |
+ | X <-- Avoid this inheritance
+ | |
+ +------------------------+ +------------------------+
+ | UnixMakefileGenerator | | SymbianCommonGenerator |
+ | or | | |
+ | NmakeMakefileGenerator | | |
+ +------------------------+ +------------------------+
+ ^ ^
+ | |
+ | |
+ | |
+ +-----------------------------+
+ | SymbianMakefileTemplate<> |
+ +-----------------------------+
+
+ We want to avoid the famous diamond problem, because if we have that, we need
+ virtual inheritance, which not all compilers like. Therefore, we break the
+ link as illustrated. Instead, we have a pointer to MakefileGenerator inside
+ SymbianCommonGenerator, and allows full access by making it a friend here.
+ */
friend class SymbianCommonGenerator;
};