vx_log.h 763 B

123456789101112131415161718192021222324252627282930
  1. #ifndef __VX_LOG_H__
  2. #define __VX_LOG_H__
  3. #include <stdarg.h>
  4. #include <VX/vx.h>
  5. #ifdef ALOG_PRINT
  6. #include <log/log.h>
  7. #define VX_LOG(...) ALOGE(__VA_ARGS__)
  8. #else
  9. #define VX_LOG(...) printf(__VA_ARGS__)
  10. #endif
  11. #define ERROR_CHECK_STATUS( status ) { \
  12. vx_status status_ = (status); \
  13. if(status_ != VX_SUCCESS) { \
  14. VX_LOG("ERROR: failed with status = (%d) at " __FILE__ "#%d\n", status_, __LINE__); \
  15. exit(1); \
  16. } \
  17. }
  18. #define ERROR_CHECK_OBJECT( obj ) { \
  19. vx_status status_ = vxGetStatus((vx_reference)(obj)); \
  20. if(status_ != VX_SUCCESS) { \
  21. VX_LOG("ERROR: failed with status = (%d) at " __FILE__ "#%d\n", status_, __LINE__); \
  22. exit(1); \
  23. } \
  24. }
  25. #endif