From 66ecc5a050a04ac8a1b3c1c6dd238c668e36ea47 Mon Sep 17 00:00:00 2001 From: hartmann Date: Mon, 10 Jan 2000 14:25:57 +0000 Subject: [PATCH] Additional braces in the Assert and AssertThrow macros. git-svn-id: https://svn.dealii.org/trunk@2180 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/exceptions.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) 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: \ -- 2.39.5