From: g0dil Date: Wed, 30 Apr 2008 08:21:44 +0000 (+0000) Subject: Console: Workaround for g++ 4.0 bug X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=f32fbba56a55712998d251e914eb6e9ad95890e3;p=senf.git Console: Workaround for g++ 4.0 bug git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@830 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Utils/Logger/Target.ih b/Utils/Logger/Target.ih index d11daf0..d80902e 100644 --- a/Utils/Logger/Target.ih +++ b/Utils/Logger/Target.ih @@ -29,6 +29,8 @@ // Custom includes #include #include +#include +#include ///////////////////////////////ih.p//////////////////////////////////////// @@ -71,14 +73,21 @@ namespace detail { template void write(std::string msg); +#ifndef DOXYGEN + + // This code takes the routing target template arguments in any order and sorts them + // by type (Stream, Area and Level). + senf::mpl::rv<0u> RouteParameterCheck_(...); senf::mpl::rv<1u> RouteParameterCheck_(StreamBase *); senf::mpl::rv<2u> RouteParameterCheck_(AreaBase *); template senf::mpl::rv<3u> RouteParameterCheck_(T*, typename T::SENFLogArea * = 0); senf::mpl::rv<4u> RouteParameterCheck_(LevelBase *); + // For g++ 4.0 (at least) we need to provide the fully scoped name for this default value. + // no idea why. It works without the scope in 4.1 template < class T, class A2, class A1, - unsigned type = SENF_MPL_RV( RouteParameterCheck_(static_cast(0)) ) > + unsigned type = SENF_MPL_RV( senf::Log::detail::RouteParameterCheck_(static_cast(0)) ) > struct RouteParameters {}; @@ -103,6 +112,8 @@ namespace detail { struct RouteParameters : public RouteParameters { + typedef RouteParameters base; + BOOST_STATIC_ASSERT( boost::is_same::value ); typedef T Stream; }; @@ -110,6 +121,8 @@ namespace detail { struct RouteParameters : public RouteParameters { + typedef RouteParameters base; + BOOST_STATIC_ASSERT( boost::is_same::value ); typedef T Area; }; @@ -117,6 +130,8 @@ namespace detail { struct RouteParameters : public RouteParameters { + typedef RouteParameters base; + BOOST_STATIC_ASSERT( boost::is_same::value ); typedef typename T::SENFLogArea Area; }; @@ -124,6 +139,8 @@ namespace detail { struct RouteParameters : public RouteParameters { + typedef RouteParameters base; + BOOST_STATIC_ASSERT( boost::is_same::value ); typedef T Level; }; @@ -139,6 +156,8 @@ namespace detail { static RV * value() { return 0; } }; +#endif + }}} ///////////////////////////////ih.e////////////////////////////////////////