1 /******************************************************************************
3 * Copyright (c) 2019 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
38 //#define PRINTF_DBG_OK
42 #define print_log(fmt, args...) printf("%s:" fmt "\n", __FUNCTION__, ## args)
43 #else /* PRINTF_LOG_OK */
44 #define print_log(fmt, args...)
45 #endif /* PRINTF_LOG_OK */
47 #define print_log(fmt, ...) printf("%s:" fmt "\n", __FUNCTION__, __VA_ARGS__)
52 #define print_dbg(fmt, args...) printf("%s:[dbg] " fmt "\n", __FUNCTION__, ## args)
53 #else /* PRINTF_LOG_OK */
54 #define print_dbg(fmt, args...)
55 #endif /* PRINTF_LOG_OK */
57 #define print_dbg(fmt, ...) printf("%s:[dbg] " fmt "\n", __FUNCTION__, __VA_ARGS__)
62 #define print_err(fmt, args...) printf("%s:[err] " fmt "\n", __FUNCTION__, ## args)
63 #else /* PRINTF_LOG_OK */
64 #define print_err(fmt, args...)
65 #endif /* PRINTF_LOG_OK */
67 #define print_err(fmt, ...) printf("%s:[err] " fmt "\n", __FUNCTION__, __VA_ARGS__)
72 #define print_inf printf
73 #else /* PRINTF_LOG_OK */
75 #endif /* PRINTF_LOG_OK */
77 #define print_inf printf
88 #define iAssert(p) if(!(p)){fprintf(stderr,\
89 "Assertion failed: %s, file %s, line %d, val %d\n",\
90 #p, __FILE__, __LINE__, p);exit(-1);}
101 #endif /* _IASSERT_*/
104 #define CHECK_NOT_NULL(param, returnValue) \
107 print_err("%s is NULL!\n", #param); \
108 return returnValue; \
111 #define CHECK_NOT_NULL(param, returnValue)
118 #endif // PHY_PRINTF_H