instrumentation: fix build on Linux

- enable C++11
- fix macro
pull/7171/head
Alexander Alekhin 9 years ago
parent 10d18a315c
commit d855608e6e
  1. 5
      cmake/OpenCVCompilerOptions.cmake
  2. 8
      modules/core/include/opencv2/core/private.hpp

@ -233,6 +233,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} --coverage")
endif()
if(ENABLE_INSTRUMENTATION)
set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} --std=c++11")
set(WITH_VTK OFF) # There are issues with VTK 6.0
endif()
set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} -DNDEBUG")
set(OPENCV_EXTRA_FLAGS_DEBUG "${OPENCV_EXTRA_FLAGS_DEBUG} -O0 -DDEBUG -D_DEBUG")
endif()

@ -502,12 +502,12 @@ CV_EXPORTS InstrNode* getCurrentNode();
auto status = ((FUN)(__VA_ARGS__));\
if(ERROR_COND){\
::cv::instr::getCurrentNode()->m_payload.m_funError = true;\
CV_INSTRUMENT_MARK_META(IMPL, ##FUN - BadExit);\
CV_INSTRUMENT_MARK_META(IMPL, #FUN " - BadExit");\
}\
return status;\
}catch(...){\
::cv::instr::getCurrentNode()->m_payload.m_funError = true;\
CV_INSTRUMENT_MARK_META(IMPL, ##FUN - BadExit);\
CV_INSTRUMENT_MARK_META(IMPL, #FUN " - BadExit");\
throw;\
}\
}else{\
@ -523,7 +523,7 @@ CV_EXPORTS InstrNode* getCurrentNode();
(FUN)(__VA_ARGS__);\
}catch(...){\
::cv::instr::getCurrentNode()->m_payload.m_funError = true;\
CV_INSTRUMENT_MARK_META(IMPL, ##FUN - BadExit);\
CV_INSTRUMENT_MARK_META(IMPL, #FUN "- BadExit");\
throw;\
}\
}else{\
@ -531,7 +531,7 @@ CV_EXPORTS InstrNode* getCurrentNode();
}\
}())
// Instrumentation information marker
#define CV_INSTRUMENT_MARK_META(IMPL, NAME, ...) {::cv::instr::IntrumentationRegion __instr_mark__(#NAME, __FILE__, __LINE__, ::cv::instr::TYPE_MARKER, IMPL);}
#define CV_INSTRUMENT_MARK_META(IMPL, NAME, ...) {::cv::instr::IntrumentationRegion __instr_mark__(NAME, __FILE__, __LINE__, ::cv::instr::TYPE_MARKER, IMPL);}
///// General instrumentation
// General OpenCV region instrumentation macro

Loading…
Cancel
Save