Enabled CV_Assert and such to print the function name with Visual C++.

Also, I made a separate macro for the current function name, which
helps simplify a lot of code that uses it.
This commit is contained in:
Roman Donchenko
2013-11-07 17:13:30 +04:00
parent 641bb7ac6b
commit 2c38be079e
8 changed files with 25 additions and 78 deletions

View File

@@ -169,7 +169,6 @@ bool DetectionBasedTracker::SeparateDetectionWork::run()
return true;
}
#ifdef __GNUC__
#define CATCH_ALL_AND_LOG(_block) \
do { \
try { \
@@ -177,29 +176,13 @@ do {
break; \
} \
catch(cv::Exception& e) { \
LOGE0("\n %s: ERROR: OpenCV Exception caught: \n'%s'\n\n", __func__, e.what()); \
LOGE0("\n %s: ERROR: OpenCV Exception caught: \n'%s'\n\n", CV_Func, e.what()); \
} catch(std::exception& e) { \
LOGE0("\n %s: ERROR: Exception caught: \n'%s'\n\n", __func__, e.what()); \
LOGE0("\n %s: ERROR: Exception caught: \n'%s'\n\n", CV_Func, e.what()); \
} catch(...) { \
LOGE0("\n %s: ERROR: UNKNOWN Exception caught\n\n", __func__); \
LOGE0("\n %s: ERROR: UNKNOWN Exception caught\n\n", CV_Func); \
} \
} while(0)
#else
#define CATCH_ALL_AND_LOG(_block) \
do { \
try { \
_block; \
break; \
} \
catch(cv::Exception& e) { \
LOGE0("\n ERROR: OpenCV Exception caught: \n'%s'\n\n", e.what()); \
} catch(std::exception& e) { \
LOGE0("\n ERROR: Exception caught: \n'%s'\n\n", e.what()); \
} catch(...) { \
LOGE0("\n ERROR: UNKNOWN Exception caught\n\n"); \
} \
} while(0)
#endif
void* workcycleObjectDetectorFunction(void* p)
{