]> git.sesse.net Git - casparcg/blobdiff - common/assert.h
[bluefish_consumer] Install GPF handler for custom thread.
[casparcg] / common / assert.h
index e077804dbb824e0002e75f120b125354eeb98a60..b8819264887212caeebdc26b30a7ad4379e30b46 100644 (file)
@@ -22,6 +22,7 @@
 #pragma once
 
 #include "log.h"
+#include "except.h"
 
 #ifdef _MSC_VER
 #define _CASPAR_DBG_BREAK _CrtDbgBreak()
 
 #define CASPAR_VERIFY(expr) do{if(!(expr)){ CASPAR_LOG(warning) << "Assertion Failed: " << \
        CASPAR_VERIFY_EXPR_STR(expr) << " " \
-       << "file:" << __FILE__ << " " \
+       << "file:" << log::remove_source_prefix(__FILE__) << " " \
        << "line:" << __LINE__ << " "; \
        _CASPAR_DBG_BREAK;\
        }}while(0);
 
+#define CASPAR_ENSURE(expr) do{if(!(expr)){ CASPAR_THROW_EXCEPTION(programming_error() << msg_info(std::string("Assertion Failed: ") + CASPAR_VERIFY_EXPR_STR(expr))); \
+       }}while(0);
+
 #ifdef _DEBUG
 #define CASPAR_ASSERT(expr) CASPAR_VERIFY(expr)
 #else
 #define CASPAR_ASSERT(expr)
-#endif
\ No newline at end of file
+#endif