diff options
author | kartofen <mladenovnasko0@gmail.com> | 2025-04-19 18:40:13 +0300 |
---|---|---|
committer | kartofen <mladenovnasko0@gmail.com> | 2025-04-19 18:40:13 +0300 |
commit | 9cc687c397beb936c7232aecf10f8906a495ab79 (patch) | |
tree | f376ff099ad2e11b7775ee728fd2c9f1dd232e94 /msgpack.h | |
parent | cb71851d51bf4af8e13c3917b361b2aac81d6733 (diff) |
yes
Diffstat (limited to 'msgpack.h')
-rw-r--r-- | msgpack.h | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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 |