12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- /*------------------------------------------------------------------------------
- -- --
- -- This software is confidential and proprietary and may be used --
- -- only as expressly authorized by a licensing agreement from --
- -- --
- -- Hantro Products Oy. --
- -- --
- -- (C) COPYRIGHT 2006 HANTRO PRODUCTS OY --
- -- ALL RIGHTS RESERVED --
- -- --
- -- The entire notice above must be reproduced --
- -- on all copies and should not be removed. --
- -- --
- --------------------------------------------------------------------------------
- --
- -- Abstract : Utility macros for debugging and tracing
- --
- --------------------------------------------------------------------------------
- --
- -- Version control information, please leave untouched.
- --
- -- $RCSfile: vp8hwd_debug.h,v $
- -- $Date: 2009/11/17 13:35:15 $
- -- $Revision: 1.1 $
- --
- ------------------------------------------------------------------------------*/
- #ifndef __VP8_DEBUG_H__
- #define __VP8_DEBUG_H__
- /* macro for assertion, used only when _ASSERT_USED is defined */
- #ifdef _ASSERT_USED
- #ifndef ASSERT
- #include <assert.h>
- #define ASSERT(expr) assert(expr)
- #endif
- #else
- #define ASSERT(expr)
- #endif
- /* macros for range checking used only when _RANGE_CHECK is defined */
- #ifdef _RANGE_CHECK
- #include <stdio.h>
- /* macro for range checking an single value */
- #define RANGE_CHECK(value, minBound, maxBound) \
- { \
- if ((value) < (minBound) || (value) > (maxBound)) \
- fprintf(stderr, "Warning: Value exceeds given limit(s)!\n"); \
- }
- /* macro for range checking an array of values */
- #define RANGE_CHECK_ARRAY(array, minBound, maxBound, length) \
- { \
- i32 i; \
- for (i = 0; i < (length); i++) \
- if ((array)[i] < (minBound) || (array)[i] > (maxBound)) \
- fprintf(stderr,"Warning: Value [%d] exceeds given limit(s)!\n",i); \
- }
- #else /* _RANGE_CHECK */
- #define RANGE_CHECK_ARRAY(array, minBound, maxBound, length)
- #define RANGE_CHECK(value, minBound, maxBound)
- #endif /* _RANGE_CHECK */
- /* macro for debug printing, used only when _DEBUG_PRINT is defined */
- #ifdef _DEBUG_PRINT
- #include <stdio.h>
- #define DEBUG_PRINT(args) printf args
- #else
- #define DEBUG_PRINT(args)
- #endif
- /* macro for error printing, used only when _ERROR_PRINT is defined */
- #ifdef _ERROR_PRINT
- #include <stdio.h>
- #define ERROR_PRINT(msg) fprintf(stderr,"ERROR: %s\n",msg)
- #else
- #define ERROR_PRINT(msg)
- #endif
- #endif /* __VP8_DEBUG_H__ */
|