1 /******************************************************************************
3 * Copyright (c) 2020 Intel.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 *******************************************************************************/
20 * @brief Modules provide debug prints and utility functions
22 * @ingroup group_source_xran
23 * @author Intel Corporation
39 //#define PRINTF_DBG_OK
43 #define print_log(fmt, args...) printf("%s:%d" fmt "\n", __FUNCTION__, __LINE__, ## args)
44 #else /* PRINTF_LOG_OK */
45 #define print_log(fmt, args...)
46 #endif /* PRINTF_LOG_OK */
48 #define print_log(fmt, ...) printf("%s:%d" fmt "\n", __FUNCTION__, __LINE__, __VA_ARGS__)
53 #define print_dbg(fmt, args...) printf("%s:%d[dbg] " fmt "\n", __FUNCTION__, __LINE__, ## args)
54 #else /* PRINTF_LOG_OK */
55 #define print_dbg(fmt, args...)
56 #endif /* PRINTF_LOG_OK */
58 #define print_dbg(fmt, ...) printf("%s:%d[dbg] " fmt "\n", __FUNCTION__, __LINE__, __VA_ARGS__)
63 #define print_err(fmt, args...) printf("%s:%d[err] " fmt "\n", __FUNCTION__, __LINE__, ## args)
64 #else /* PRINTF_LOG_OK */
65 #define print_err(fmt, args...)
66 #endif /* PRINTF_LOG_OK */
68 #define print_err(fmt, ...) printf("%s:%d[err] " fmt "\n", __FUNCTION__, __LINE__, __VA_ARGS__)
73 #define print_inf printf
74 #else /* PRINTF_LOG_OK */
76 #endif /* PRINTF_LOG_OK */
78 #define print_inf printf
89 #define iAssert(p) if(!(p)){fprintf(stderr,\
90 "Assertion failed: %s, file %s, line %d, val %d\n",\
91 #p, __FILE__, __LINE__, p);exit(-1);}
102 #endif /* _IASSERT_*/
105 #define CHECK_NOT_NULL(param, returnValue) \
108 print_err("%s is NULL!\n", #param); \
109 return returnValue; \
112 #define CHECK_NOT_NULL(param, returnValue)
119 #endif // PHY_PRINTF_H