assert.h
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #if !defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG)
13 #include <iostream>
14 #include <cstdlib>
15 
21 #define INTEROP_ASSERT(TST) \
22  if(!(TST)) {\
23  std::cerr << __FILE__<< "::" << __FUNCTION__<< " (" << __LINE__ << ")" << " " #TST << std::endl;\
24  std::abort();\
25  }
26 
32 #define INTEROP_ASSERTMSG(TST, MSG) \
33  if(!(TST)) {\
34  std::cerr << __FILE__<< "::" << __FUNCTION__<< " (" << __LINE__ << ")" << " " #TST << " " << MSG << std::endl;\
35  std::abort();\
36  }
37 
38 #else
39 
45 #define INTEROP_ASSERT(TST) (void)0;
46 
52 #define INTEROP_ASSERTMSG(TST,MSG) (void)0;
53 
54 #endif
55