1 /******************************************************************************
\r
3 * Copyright (c) 2019 Intel.
\r
5 * Licensed under the Apache License, Version 2.0 (the "License");
\r
6 * you may not use this file except in compliance with the License.
\r
7 * You may obtain a copy of the License at
\r
9 * http://www.apache.org/licenses/LICENSE-2.0
\r
11 * Unless required by applicable law or agreed to in writing, software
\r
12 * distributed under the License is distributed on an "AS IS" BASIS,
\r
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
14 * See the License for the specific language governing permissions and
\r
15 * limitations under the License.
\r
17 *******************************************************************************/
\r
20 * @brief Modules provide debug prints and utility functions
\r
21 * @file xran_printf.h
\r
22 * @ingroup group_source_xran
\r
23 * @author Intel Corporation
\r
26 #ifndef XRAN_PRINTF_H
\r
27 #define XRAN_PRINTF_H
\r
35 #define PRINTF_LOG_OK
\r
36 #define PRINTF_INF_OK
\r
37 #define PRINTF_ERR_OK
\r
38 //#define PRINTF_DBG_OK
\r
41 #ifdef PRINTF_LOG_OK
\r
42 #define print_log(fmt, args...) printf("%s:" fmt "\n", __FUNCTION__, ## args)
\r
43 #else /* PRINTF_LOG_OK */
\r
44 #define print_log(fmt, args...)
\r
45 #endif /* PRINTF_LOG_OK */
\r
47 #define print_log(fmt, ...) printf("%s:" fmt "\n", __FUNCTION__, __VA_ARGS__)
\r
51 #ifdef PRINTF_DBG_OK
\r
52 #define print_dbg(fmt, args...) printf("%s:[dbg] " fmt "\n", __FUNCTION__, ## args)
\r
53 #else /* PRINTF_LOG_OK */
\r
54 #define print_dbg(fmt, args...)
\r
55 #endif /* PRINTF_LOG_OK */
\r
57 #define print_dbg(fmt, ...) printf("%s:[dbg] " fmt "\n", __FUNCTION__, __VA_ARGS__)
\r
61 #ifdef PRINTF_ERR_OK
\r
62 #define print_err(fmt, args...) printf("%s:[err] " fmt "\n", __FUNCTION__, ## args)
\r
63 #else /* PRINTF_LOG_OK */
\r
64 #define print_err(fmt, args...)
\r
65 #endif /* PRINTF_LOG_OK */
\r
67 #define print_err(fmt, ...) printf("%s:[err] " fmt "\n", __FUNCTION__, __VA_ARGS__)
\r
71 #ifdef PRINTF_INF_OK
\r
72 #define print_inf printf
\r
73 #else /* PRINTF_LOG_OK */
\r
75 #endif /* PRINTF_LOG_OK */
\r
77 #define print_inf printf
\r
88 #define iAssert(p) if(!(p)){fprintf(stderr,\
\r
89 "Assertion failed: %s, file %s, line %d, val %d\n",\
\r
90 #p, __FILE__, __LINE__, p);exit(-1);}
\r
101 #endif /* _IASSERT_*/
\r
103 #ifdef CHECK_PARAMS
\r
104 #define CHECK_NOT_NULL(param, returnValue) \
\r
105 if (param == NULL) \
\r
107 print_err("%s is NULL!\n", #param); \
\r
108 return returnValue; \
\r
111 #define CHECK_NOT_NULL(param, returnValue)
\r
118 #endif // PHY_PRINTF_H
\r