From: tho Date: Wed, 7 Dec 2011 13:58:47 +0000 (+0000) Subject: site_scons: support for clang/llvm X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=23a1bdee20b3fb19bd442efed8aa73b2bf0d585a;p=senf.git site_scons: support for clang/llvm git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1834 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Utils/Statistics.cc b/senf/Utils/Statistics.cc index 43cc39f..6513828 100644 --- a/senf/Utils/Statistics.cc +++ b/senf/Utils/Statistics.cc @@ -233,6 +233,7 @@ prefix_ senf::Statistics::Statistics() } prefix_ void senf::Statistics::consoleList(std::ostream & os) + const { os << "RANK WIN MIN AVG MAX\n"; StatisticsBase::consoleList(0, os); diff --git a/senf/Utils/Statistics.cci b/senf/Utils/Statistics.cci index 8e7b093..c833615 100644 --- a/senf/Utils/Statistics.cci +++ b/senf/Utils/Statistics.cci @@ -143,6 +143,7 @@ prefix_ std::string senf::StatisticsBase::path() } prefix_ senf::StatisticsData senf::StatisticsBase::data() + const { return StatisticsData(min_, avg_, max_, dev_, 0); } @@ -184,7 +185,7 @@ prefix_ void senf::Statistics::operator()(float min, float avg, float max, float prefix_ void senf::Statistics::operator()(StatisticsData const & data) { - enter(1, data.min, data.avg, data.max, data.stddev); + enter(1, data.min, data.avg, data.max, data.stddev); } prefix_ void senf::Statistics::operator()(float value, float dev) diff --git a/senf/Utils/Statistics.hh b/senf/Utils/Statistics.hh index cdea0da..4d64692 100644 --- a/senf/Utils/Statistics.hh +++ b/senf/Utils/Statistics.hh @@ -74,6 +74,7 @@ namespace senf { { typedef std::map Children; + // why we can't use ::__gnu_cxx::select2nd instead?!?! struct Transform { typedef Children::value_type & first_argument_type; typedef Collector & result_type; @@ -229,10 +230,9 @@ namespace senf { \param[in] n size of sliding average window */ //\} - StatisticsData data(); ///< Get the Statistics data as senf::StatisticsData - /**< Return a Statistic Data object containing values - from this instance. - */ + StatisticsData data() const; ///< Get the Statistics data as senf::StatisticsData + /**< Return a Statistic Data object containing values + from this instance. */ //-//////////////////////////////////////////////////////////////////////// @@ -491,7 +491,7 @@ namespace senf { StatisticsBase::OutputProxy output(unsigned n = 1u); - void consoleList(std::ostream & os); + void consoleList(std::ostream & os) const; void consoleCollect(std::vector & ranks); boost::shared_ptr consoleOutput( std::vector & ranks, unsigned window); diff --git a/senf/Utils/signalnames.cc b/senf/Utils/signalnames.cc index 7545e72..eee2635 100644 --- a/senf/Utils/signalnames.cc +++ b/senf/Utils/signalnames.cc @@ -29,12 +29,9 @@ \brief signalnames non-inline non-template implementation */ #include "signalnames.hh" -//#include "signalnames.ih" // Custom includes -#include -//#include "signalnames.mpp" #define prefix_ //-///////////////////////////////////////////////////////////////////////////////////////////////// @@ -54,7 +51,6 @@ prefix_ std::string const & senf::signalName(int signal) //-///////////////////////////////////////////////////////////////////////////////////////////////// #undef prefix_ -//#include "signalnames.mpp" // Local Variables: diff --git a/site_scons/senfutil.py b/site_scons/senfutil.py index 8216902..da24b19 100644 --- a/site_scons/senfutil.py +++ b/site_scons/senfutil.py @@ -225,7 +225,9 @@ def DefaultOptions(env): # Set nice default options env.Append( - CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', "${profile and '-pg' or None}" ], + CXXFLAGS_CLANG = [ '-Wno-unneeded-internal-declaration' ], # needed for BOOST_PARAMETER_KEYWORD + CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', "${profile and '-pg' or None}", + '${str(CXX).split("/")[-1] == "clang++" and "$CXXFLAGS_CLANG" or None}' ], CXXFLAGS_final = [ '-O3', '-fno-threadsafe-statics', '-fno-stack-protector', "${profile and ' ' or '-ffunction-sections'}" ], CXXFLAGS_normal = [ '-O2', '-g' ],