|
|
@@ -19,12 +19,13 @@ typedef struct {
|
|
19
|
19
|
#define _msgparam_cast_apply(x) ((long) (x)),
|
|
20
|
20
|
#define msgparam_cast_apply(...) EVAL(MAP(_msgparam_cast_apply, __VA_ARGS__))
|
|
21
|
21
|
|
|
|
22
|
+/*计算出有多少个参数, 参数数组*/
|
|
22
|
23
|
#define ELOG(o, msg, ...) do { \
|
|
23
|
24
|
__attribute__((section("elog"))) static const char p_msg[] = msg; \
|
|
24
|
25
|
IF_ELSE(HAS_ARGS(__VA_ARGS__))( \
|
|
25
|
|
- elog_put(o, p_msg, ELOG_NARG(__VA_ARGS__)/*计算出有多少个参数*/, (msgparam_t[]){ msgparam_cast_apply(__VA_ARGS__) }/*参数数组*/); \
|
|
|
26
|
+ elog_put(o, p_msg, ELOG_NARG(__VA_ARGS__), (msgparam_t[]){ msgparam_cast_apply(__VA_ARGS__) }); \
|
|
26
|
27
|
)( \
|
|
27
|
|
- elog_put(o, p_msg, 0, (msgparam_t[]){}); \
|
|
|
28
|
+ elog_put(o, p_msg, 0, NULL); \
|
|
28
|
29
|
) \
|
|
29
|
30
|
} while(0)
|
|
30
|
31
|
|