X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FException.cc;h=8b2f2802c6e88020f79a9469ffa284fd0516b9e3;hb=62da0fc2f859a98e105b45859c346750a1435ebb;hp=de36e8620af07d6054d0eae2bf68124151fda45d;hpb=96d3a2a43b4e6d7693a136a3adeb099440f19068;p=senf.git diff --git a/Utils/Exception.cc b/Utils/Exception.cc index de36e86..8b2f280 100644 --- a/Utils/Exception.cc +++ b/Utils/Exception.cc @@ -1,9 +1,9 @@ // $Id$ // // Copyright (C) 2006 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -27,26 +27,13 @@ //#include "Exception.ih" // Custom includes -#include -#include #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// -prefix_ void senf::SystemException::init() -{ - // We normallyl don't want to consume memory in an exception, - // however all other solutions to format the message are terribly - // ugly (since thay must use a static and shared buffer ...) - std::stringstream s; - if (where_) - s << where_ << ": "; - s << "(" << code_ << ") " << description(); - buffer_ = s.str(); -} - -prefix_ void senf::throwErrno(char const * where, int code) +prefix_ void senf::throwErrno(std::string const & where, int code) { +#ifndef SENF_NO_ERRNOEXC switch (code) { // BOOST_PP_REPEAT is limited to 256 repetitions. The max errno value I found in any header file @@ -73,6 +60,9 @@ prefix_ void senf::throwErrno(char const * where, int code) default: throw SystemException(where, code); } +#else + throw SystemException(where, code); +#endif } ///////////////////////////////cc.e////////////////////////////////////////