From: derpeter Date: Thu, 22 Apr 2010 09:51:51 +0000 (+0000) Subject: added some ifdef to make senf compile against ulibc if its build final X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=6f7f9658177cc8937e5e796eeec0027dd4850966;p=senf.git added some ifdef to make senf compile against ulibc if its build final git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1600 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Scheduler/FIFORunner.cc b/senf/Scheduler/FIFORunner.cc index 0e2935a..51c0032 100644 --- a/senf/Scheduler/FIFORunner.cc +++ b/senf/Scheduler/FIFORunner.cc @@ -257,7 +257,7 @@ prefix_ void senf::scheduler::detail::FIFORunner::watchdogError() write(1, "): ", 3); write(1, runningName_.c_str(), runningName_.size()); write(1, " at\n ", 3); - +#ifdef SENF_DEBUG unsigned nEntries( ::backtrace(entries, SENF_DEBUG_BACKTRACE_NUMCALLERS) ); for (unsigned i (0); i < nEntries; ++i) { write(1, " 0x", 3); @@ -267,6 +267,7 @@ prefix_ void senf::scheduler::detail::FIFORunner::watchdogError() write(1, &(hex[ (v ) & 0x0f ]), 1); } } +#endif write(1, "\n", 1); #ifdef SENF_DEBUG diff --git a/senf/Utils/Backtrace.cc b/senf/Utils/Backtrace.cc index 9ae708d..3bd09c0 100644 --- a/senf/Utils/Backtrace.cc +++ b/senf/Utils/Backtrace.cc @@ -27,7 +27,9 @@ //#include "Backtrace.ih" // Custom includes -#include +#ifdef SENF_DEBUG + #include +#endif #include #include #include "Buffer.hh" @@ -38,6 +40,7 @@ prefix_ void senf::formatBacktrace(std::ostream & os, void ** backtrace, unsigned numEntries) { +#ifdef SENF_DEBUG char ** symbols (::backtrace_symbols(backtrace, numEntries)); static boost::regex const backtraceRx @@ -71,13 +74,20 @@ prefix_ void senf::formatBacktrace(std::ostream & os, void ** backtrace, unsigne os << " " << sym << "\n"; } free(symbols); +#endif +#ifndef SENF_DEBUG + os << "no backtrace available please compile SENF without final=1\n"; +#endif + } prefix_ void senf::backtrace(std::ostream & os, unsigned numEntries) { - SENF_SCOPED_BUFFER( void*, entries, numEntries); - unsigned n ( ::backtrace(entries, numEntries) ); - senf::formatBacktrace(os, entries, n); +#ifdef SENF_DEBUG + SENF_SCOPED_BUFFER( void*, entries, numEntries); + unsigned n ( ::backtrace(entries, numEntries) ); + senf::formatBacktrace(os, entries, n); +#endif } ///////////////////////////////cc.e//////////////////////////////////////// diff --git a/senf/Utils/Exception.cc b/senf/Utils/Exception.cc index caa13c4..1b3763c 100644 --- a/senf/Utils/Exception.cc +++ b/senf/Utils/Exception.cc @@ -27,7 +27,9 @@ //#include "Exception.ih" // Custom includes -#include +#ifdef SENF_DEBUG + #include +#endif #include #include #include "Backtrace.hh"