]> git.sesse.net Git - casparcg/blobdiff - common/utility/assert.h
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
[casparcg] / common / utility / assert.h
index 29a149719c3e56af99d6e730745b5bc0da1a1061..c30bcf94ba43bc6eabe27ffd718109bfa15acce1 100644 (file)
@@ -1,3 +1,22 @@
+/*\r
+* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
+*\r
+*  This file is part of CasparCG.\r
+*\r
+*    CasparCG is free software: you can redistribute it and/or modify\r
+*    it under the terms of the GNU General Public License as published by\r
+*    the Free Software Foundation, either version 3 of the License, or\r
+*    (at your option) any later version.\r
+*\r
+*    CasparCG is distributed in the hope that it will be useful,\r
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+*    GNU General Public License for more details.\r
+\r
+*    You should have received a copy of the GNU General Public License\r
+*    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
+*\r
+*/\r
 #pragma once\r
 \r
 #include "../log/log.h"\r
 #define _CASPAR_DBG_BREAK\r
 #endif\r
 \r
-#define CASPAR_ASSERT_EXPR_STR(str) #str\r
+#define CASPAR_VERIFY_EXPR_STR(str) #str\r
 \r
-#define CASPAR_ASSERT(expr) do{if(!(expr)) CASPAR_LOG(warning) << "\n\nAssertion Failed:\n" << \\r
-       CASPAR_ASSERT_EXPR_STR(expr) << "\n" \\r
-       __FILE__ << "\n"; \\r
+#define CASPAR_VERIFY(expr) do{if(!(expr)){ CASPAR_LOG(warning) << "Assertion Failed: " << \\r
+       CASPAR_VERIFY_EXPR_STR(expr) << " " \\r
+       << "file:" << __FILE__ << " " \\r
+       << "line:" << __LINE__ << " "; \\r
        _CASPAR_DBG_BREAK;\\r
-       }while(0);
\ No newline at end of file
+       }}while(0);\r
+\r
+#ifdef _DEBUG\r
+#define CASPAR_ASSERT(expr) CASPAR_VERIFY(expr)\r
+#else\r
+#define CASPAR_ASSERT(expr)\r
+#endif
\ No newline at end of file