The original definitions prevent external programs/libraries from compiling
without warnings when using these headers and -std=gnu99 (relaxed C99 mode).
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Ivan Boule <ivan.boule@6wind.com>
Acked-by: Damien Millescamps <damien.millescamps@6wind.com>
};
#ifdef RTE_LIBRTE_CMDLINE_DEBUG
};
#ifdef RTE_LIBRTE_CMDLINE_DEBUG
-#define dprintf(fmt, ...) printf("line %3.3d - " fmt, __LINE__, ##__VA_ARGS__)
+#define dprintf_(fmt, ...) printf("line %3.3d - " fmt "%.0s", __LINE__, __VA_ARGS__)
+#define dprintf(...) dprintf_(__VA_ARGS__, "dummy")
-#define dprintf(args...) do {} while(0)
+#define dprintf(...) (void)0
* @param args
* The variable list of arguments.
*/
* @param args
* The variable list of arguments.
*/
-#define rte_panic(format, args...) __rte_panic(__func__, format, ## args)
+#define rte_panic_(func, format, ...) __rte_panic(func, format "%.0s", __VA_ARGS__)
+#define rte_panic(...) rte_panic_(__func__, __VA_ARGS__, "dummy")
/*
* Provide notification of a critical non-recoverable error and stop.
/*
* Provide notification of a critical non-recoverable error and stop.
* - 0: Success.
* - Negative on error.
*/
* - 0: Success.
* - Negative on error.
*/
-#define RTE_LOG(l, t, fmt, args...) ({ \
- if ((RTE_LOG_##l <= RTE_LOG_LEVEL) && \
- (RTE_LOG_##l <= rte_logs.level) && \
- (RTE_LOGTYPE_##t & rte_logs.type)) { \
- rte_log(RTE_LOG_##l, RTE_LOGTYPE_##t, \
- #t ": " fmt, ## args); \
- } \
-})
+#define RTE_LOG(l, t, ...) \
+ (((RTE_LOG_ ## l <= RTE_LOG_LEVEL) && \
+ (RTE_LOG_ ## l <= rte_logs.level) && \
+ (RTE_LOGTYPE_ ## t & rte_logs.type)) ? \
+ rte_log(RTE_LOG_ ## l, \
+ RTE_LOGTYPE_ ## t, # t ": " __VA_ARGS__) : \
+ 0)