pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] r4134 - trunk/pingus/src/util


From: grumbel
Subject: [Pingus-CVS] r4134 - trunk/pingus/src/util
Date: Tue, 1 Feb 2011 19:01:58 +0100

Author: grumbel
Date: 2011-02-01 19:01:58 +0100 (Tue, 01 Feb 2011)
New Revision: 4134

Added:
   trunk/pingus/src/util/raise_exception.hpp
Log:
Some cleanup in the init code


Added: trunk/pingus/src/util/raise_exception.hpp
===================================================================
--- trunk/pingus/src/util/raise_exception.hpp                           (rev 0)
+++ trunk/pingus/src/util/raise_exception.hpp   2011-02-01 18:01:58 UTC (rev 
4134)
@@ -0,0 +1,33 @@
+//  Pingus - A free Lemmings clone
+//  Copyright (C) 1998-2011 Ingo Ruhnke <address@hidden>
+//
+//  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
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef HEADER_PINGUS_UTIL_RAISE_EXCEPTION_HPP
+#define HEADER_PINGUS_UTIL_RAISE_EXCEPTION_HPP
+
+#include <sstream>
+#include <string>
+
+std::string log_pretty_print(const std::string& str);
+
+#define raise_exception(type, expr) do {  \
+  std::ostringstream b42465a70169; \
+  b42465a70169 << log_pretty_print(__PRETTY_FUNCTION__) << ": " << expr; \
+  throw type(b42465a70169.str()); \
+} while(false)
+
+#endif
+
+/* EOF */


Property changes on: trunk/pingus/src/util/raise_exception.hpp
___________________________________________________________________
Added: svn:eol-style
   + native




reply via email to

[Prev in Thread] Current Thread [Next in Thread]