HbbTv  17.9.0
Open source HBBTV engine
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
dbgfuncs.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2013 Ocean Blue Software Ltd
4  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
25 // pre-processor mechanism so multiple inclusions don't cause compilation error
26 #ifndef _DBGFUNCS_H
27 #define _DBGFUNCS_H
28 
29 // uncomment this for assert prints
30 //#define DEBUG_ASSERT
31 
32 // uncomment this for standard ANSI C assertions
33 //#define DEBUG_ASSERT_STANDARD
34 
35 // uncomment this for func start/end messages
36 //#define DEBUG_FUNCTION
37 
38 #ifdef DEBUG_ASSERT_STANDARD
39  #undef assert
40  #include <assert.h>
41 #endif
42 
43 // function profiling macros
44 #ifdef DEBUG_FUNCTIONS
45 #include "hbbtv_sif_debug.h"
46  #define FUNCTION_START(x) HBBTV_DBGPrint("START: " # x "\n")
47  #define FUNCTION_FINISH(x) HBBTV_DBGPrint("END : " # x "\n")
48 #else
49  #define FUNCTION_START(x)
50  #define FUNCTION_FINISH(x)
51 #endif
52 
53 // assertion macros
54 #ifdef DEBUG_ASSERT
55  #include "hbbtv_sif_debug.h"
56  #define ASSERT(assertion) if (!(assertion)) { HBBTV_DBGPrint("ASSERT: %s - %s:%d\n", #assertion, __FILE__, __LINE__); }
57 #else // DEBUG_ASSERT
58  #ifdef DEBUG_ASSERT_STANDARD
59  #define ASSERT(assertion) assert(assertion)
60  #else // DEBUG_ASSERT_STANDARD
61  #define ASSERT(assertion)
62  #endif // DEBUG_ASSERT_STANDARD
63 #endif // DEBUG_ASSERT
64 
65 #endif // _DBGFUNCS_H
66 
System Interface, debug.