From: hartmann Date: Mon, 10 Jan 2000 14:25:57 +0000 (+0000) Subject: Additional braces in the Assert and AssertThrow macros. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66ecc5a050a04ac8a1b3c1c6dd238c668e36ea47;p=dealii-svn.git Additional braces in the Assert and AssertThrow macros. git-svn-id: https://svn.dealii.org/trunk@2180 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/exceptions.h b/deal.II/base/include/base/exceptions.h index f2469e4c10..1ae7fd10b8 100644 --- a/deal.II/base/include/base/exceptions.h +++ b/deal.II/base/include/base/exceptions.h @@ -418,11 +418,13 @@ void __IssueError_Throw (const char *file, * @see ExceptionBase * @author Wolfgang Bangerth, November 1997, extensions 1998 */ -#define Assert(cond, exc) \ - if (!(cond)) \ - __IssueError_Assert (__FILE__, \ - __LINE__, \ - __PRETTY_FUNCTION__, #cond, #exc, exc) +#define Assert(cond, exc) \ + { \ + if (!(cond)) \ + __IssueError_Assert (__FILE__, \ + __LINE__, \ + __PRETTY_FUNCTION__, #cond, #exc, exc);\ + } #else //////////////////////////////////////// @@ -443,11 +445,13 @@ void __IssueError_Throw (const char *file, * @see ExceptionBase * @author Wolfgang Bangerth, November 1997, extensions 1998 */ -#define AssertThrow(cond, exc) \ - if (!(cond)) \ - __IssueError_Throw (__FILE__, \ - __LINE__, \ - __PRETTY_FUNCTION__, #cond, #exc, exc) +#define AssertThrow(cond, exc) \ + { \ + if (!(cond)) \ + __IssueError_Throw (__FILE__, \ + __LINE__, \ + __PRETTY_FUNCTION__, #cond, #exc, exc);\ + } @@ -471,7 +475,7 @@ class Exception0 : public ExceptionBase {}; class Exception1 : public ExceptionBase { \ public: \ Exception1 (const type1 a1) : arg1 (a1) {}; \ - virtual void PrintInfo (ostream &out) const { \ + virtual void PrintInfo (ostream &out) const { \ out outsequence << endl; \ }; \ private: \