4 * Copyright 2013 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.1 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://floralicense.org/license/
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef _SMSC_DEBUG_H_INCLUDED_
21 #define _SMSC_DEBUG_H_INCLUDED_
23 //#define SMSC_DEBUG_SILENT
24 #ifdef SMSC_DEBUG_SILENT
26 #define SMSC_TRACE_BEGIN
27 #define SMSC_TRACE_END
28 #else /* !SMSC_DEBUG_SILENT */
30 /*#define SMSC_DEBUG_STANDALONE*/
31 #ifdef SMSC_DEBUG_STANDALONE
33 /* standalone debugging */
35 #define SMSC_DEBUG(fmt, arg...) do { \
36 printf("DEBUG: %s: " fmt "\n", __FUNCTION__, ##arg); } while (0)
37 #define SMSC_TRACE_BEGIN SMSC_DEBUG("TRACE: %s enter", __FUNCTION__)
38 #define SMSC_TRACE_END SMSC_DEBUG("TRACE: %s leave", __FUNCTION__)
40 #define SMSC_IF_FREE_MEM(mem) \
47 #define SMSC_RET_IF(expr, fmt, args...) \
50 PTS_PRT("[%s] Return, message "fmt, #expr, ##args );\
54 #define SMSC_RETV_IF(expr, val, fmt, args...) \
57 PTS_PRT("[%s] Return value, message "fmt, #expr, ##args );\
62 #else /* !SMSC_DEBUG_STANDALONE */
64 #include <pts_debug.h>
65 #define SMSC_DEBUG(fmt, arg...) PTS_DEBUG(fmt, ##arg)
66 #define SMSC_TRACE_BEGIN PTS_TRACE_BEGIN
67 #define SMSC_TRACE_END PTS_TRACE_END
69 #define SMSC_IF_FREE_MEM PTS_IF_FREE_MEM
70 #define SMSC_RET_IF PTS_RET_IF
71 #define SMSC_RETV_IF PTS_RETV_IF
73 #endif /* SMSC_DEBUG_STANDALONE */
74 #endif /* SMSC_DEBUG_SILENT */
77 #endif /* _SMSC_DEBUG_H_INCLUDED_ */