From 4746dcd233fc249449f02b0f4fc6978a21024f21 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Wed, 20 Aug 2008 15:45:36 +0100 Subject: [PATCH] Fix build with gcc 4.3 (Explanation: 4.3 detects when a local typedef redeclares a templated type from an enclosing scope. This was never legal anyway) --- .gitignore | 2 ++ src/common/meta/configflags.hpp | 15 +++++++++------ src/proc/asset/buildinstruct.hpp | 10 +++++++++- src/proc/asset/procpatt.cpp | 3 ++- src/proc/engine/nodewiring.hpp | 2 +- src/proc/mobject/session/defsregistry.hpp | 4 ++-- .../proc/mobject/session/defsregistryimpltest.cpp | 4 ++-- 7 files changed, 27 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index a42a27923..69cb7933a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *~ *.tar.* .[^.]* +*.o *.os *.gch ,valgrind.log* @@ -13,5 +14,6 @@ bin/* autom4te.cache/* scripts/* configure +config.log aclocal.m4 semantic.cache diff --git a/src/common/meta/configflags.hpp b/src/common/meta/configflags.hpp index fa24bfc97..c63552855 100644 --- a/src/common/meta/configflags.hpp +++ b/src/common/meta/configflags.hpp @@ -107,26 +107,29 @@ namespace lumiera { > struct ConfigSetFlag > { - typedef Config Config; + typedef typelist::Config Config; }; - /** build a configuration type for the given list-of-flags */ - template > - struct DefineConfigByFlags + /** build a configuration type from a list-of-flags */ + template > + struct BuildConfigFromFlags { typedef CONF Config; typedef Config Type; }; template - struct DefineConfigByFlags< Node,FLAGS>, CONF> + struct BuildConfigFromFlags< Node,FLAGS>, CONF> { typedef typename ConfigSetFlag< Fl - , typename DefineConfigByFlags::Config + , typename BuildConfigFromFlags::Config >::Config Config; typedef Config Type; }; + /** create a configuration type for the given list-of-flags */ + template + struct DefineConfigByFlags : BuildConfigFromFlags { }; /** diff --git a/src/proc/asset/buildinstruct.hpp b/src/proc/asset/buildinstruct.hpp index 8b1162103..dee85d58d 100644 --- a/src/proc/asset/buildinstruct.hpp +++ b/src/proc/asset/buildinstruct.hpp @@ -108,7 +108,15 @@ namespace asset : public InstructEntry { template - BuildInstruct (T& instr) : InstructEntry(instr) {} + BuildInstruct (T& instr) : InstructEntry() {} + + // TODO: this ctor is *not* correct, just to make it compile + // There is a strange problem with boost::variant, probably becausse the + // template parameter T could be anything (but actually we know it's one + // of our Instruction types. + // I have to reinvestigate this design anyway, and probably will replace + // the boost::variant by something else, derive from a common base or such. + // Note: as of 8/2008 ProcPatt is just a draft and not implemented. }; diff --git a/src/proc/asset/procpatt.cpp b/src/proc/asset/procpatt.cpp index d5173b9ea..5f2c842fd 100644 --- a/src/proc/asset/procpatt.cpp +++ b/src/proc/asset/procpatt.cpp @@ -91,7 +91,8 @@ namespace asset else { DoAttach entry(node, where); - instructions_.push_back(BuildInstruct(entry)); + BuildInstruct instruction(entry); + instructions_.push_back(instruction); } TODO ("declare dependency??"); return *this; diff --git a/src/proc/engine/nodewiring.hpp b/src/proc/engine/nodewiring.hpp index 442ca4297..6ad582efc 100644 --- a/src/proc/engine/nodewiring.hpp +++ b/src/proc/engine/nodewiring.hpp @@ -37,7 +37,7 @@ namespace engine { class WiringFactory; - namespace { class WiringFactoryImpl; } + namespace { class WiringFactoryImpl; } ////TODO: better use a named implementation namespace! (produces warings on gcc 4.3) /** diff --git a/src/proc/mobject/session/defsregistry.hpp b/src/proc/mobject/session/defsregistry.hpp index 7d7589110..64f84ab32 100644 --- a/src/proc/mobject/session/defsregistry.hpp +++ b/src/proc/mobject/session/defsregistry.hpp @@ -52,7 +52,7 @@ namespace mobject using boost::lambda::_1; using boost::lambda::var; - namespace // Implementation details + namespace // Implementation details //////////////////TODO better a named implementation namespace (avoids warnings on gcc 4.3) { struct TableEntry { @@ -159,7 +159,7 @@ namespace mobject template size_t Slot::index (0); - } + } // (End) impl namespace /** diff --git a/tests/components/proc/mobject/session/defsregistryimpltest.cpp b/tests/components/proc/mobject/session/defsregistryimpltest.cpp index e605880a1..e2c515600 100644 --- a/tests/components/proc/mobject/session/defsregistryimpltest.cpp +++ b/tests/components/proc/mobject/session/defsregistryimpltest.cpp @@ -102,8 +102,8 @@ namespace mobject { scoped_ptr reg_; - typedef P > O; - typedef P > P; + typedef lumiera::P > O; + typedef lumiera::P > P; typedef Query > Q13; typedef Query > Q23;