From 9cc687c397beb936c7232aecf10f8906a495ab79 Mon Sep 17 00:00:00 2001 From: kartofen Date: Sat, 19 Apr 2025 18:40:13 +0300 Subject: yes --- msgpack.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'msgpack.h') diff --git a/msgpack.h b/msgpack.h index 98ff5cc..0979605 100644 --- a/msgpack.h +++ b/msgpack.h @@ -35,7 +35,7 @@ * an already allocated size_t *, with * as many members as bytes in the bin * string - * + * * ... * */ @@ -43,7 +43,7 @@ typedef struct mp_msgpack { uint8_t *bin; size_t size; - + // struct mp_membuf { // uintptr_t offset; // size_t *buf; @@ -179,7 +179,7 @@ int msgpack_write_array (msgpack_t *pack, const size_t *m); X(MSGPACK_ERROR_UNSUFFICIENT_CAPACITY) \ X(MSGPACK_ERROR_UNEXPECTED_END) -#define X_TO_ENUM(e) e, +#define X_TO_ENUM(e) e, #define X_TO_STRING(e) [e] = #e, enum msgpack_type { @@ -224,9 +224,8 @@ static const char * const msgpack_error_string[] = { */ - #define __EXPAND(...) __VA_ARGS__ -#define __MSGPACK_CHECK_DEFER(...) __MSGPACK_CHECK(__VA_ARGS__) +#define __EXPAND_CALL(c, ...) c(__VA_ARGS__) #define __MSGPACK_CHECK(call, body_suc, body_err, type_var, err_var, rest_var) \ do { \ int __r = (call); \ @@ -238,8 +237,8 @@ static const char * const msgpack_error_string[] = { } while(0) #define MSGPACK_CHECK(call, arg, body_err) \ - __MSGPACK_CHECK_DEFER(call, ;, body_err, __EXPAND arg) + __EXPAND_CALL(__MSGPACK_CHECK, call, ;, body_err, __EXPAND arg) #define MSGPACK_CHECK2(call, arg, body_suc, body_err) \ - __MSGPACK_CHECK_DEFER(call, body_suc, body_err, __EXPAND arg) + __EXPAND_CALL(__MSGPACK_CHECK, call, body_suc, body_err, __EXPAND arg) #endif -- cgit v1.2.3