DSMCC
15.3.1
|
00001 /******************************************************************************* 00002 * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org) 00003 * Copyright © 2004 Ocean Blue Software Ltd 00004 * 00005 * This file is part of a DTVKit Software Component 00006 * You are permitted to copy, modify or distribute this file subject to the terms 00007 * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org 00008 * 00009 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 00010 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES 00011 * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. 00012 * 00013 * If you or your organisation is not a member of DTVKit then you have access 00014 * to this source code outside of the terms of the licence agreement 00015 * and you are expected to delete this and any associated files immediately. 00016 * Further information on DTVKit, membership and terms can be found at www.dtvkit.org 00017 *******************************************************************************/ 00024 #ifndef SIQ_DEBUG_H 00025 #define SIQ_DEBUG_H 00026 00027 #ifndef NDEBUG 00028 00029 #include <stdio.h> 00030 #ifdef DEBUG_ASSERT 00031 #include "stb_debug.h" 00032 #define ASSERT(condition) if (!(condition)) STB_SPDebugAssertFail(__FILE__, __LINE__,#condition); 00033 #else 00034 #include <assert.h> 00035 #define ASSERT(condition) assert(condition); 00036 #endif 00037 00038 #define ERRLOG(x, ...) if ( siq->setup.errPrintf ) \ 00039 siq->setup.errPrintf( "%s:%d " x "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); 00040 00041 #define DBGLOG(t,x, ...) if ( siq->setup.dbgPrintf && (siq->setup.dbgState & t) ) \ 00042 siq->setup.dbgPrintf( "%s:%d " x "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); 00043 00044 #else 00045 00046 #define ASSERT(condition) 00047 00048 #define ERRLOG(x, ...) 00049 #define DBGLOG(t,x, ...) 00050 00051 #endif 00052 00053 #ifdef DEBUG_FUNCS 00054 #define FUNCTION_START(x) DBGLOG(DS_FUNC," start") 00055 #define FUNCTION_FINISH(x) DBGLOG(DS_FUNC," finish") 00056 #else 00057 #define FUNCTION_START(x) 00058 #define FUNCTION_FINISH(x) 00059 #endif 00060 00061 #endif /*SIQ_DEBUG_H*/