diff options
author | Mattias Andrée <maandree@kth.se> | 2020-06-21 12:05:31 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2020-06-21 12:05:31 +0200 |
commit | e911a3182522ee2fc8ee8c03b33029a209e4c1b5 (patch) | |
tree | 7ce8bc3760571b1f7accfcb3cf9b3c19552f9efa /common.h | |
parent | Add LIBAXL_SYNTHETIC_EVENT_BIT (diff) | |
download | libaxl-e911a3182522ee2fc8ee8c03b33029a209e4c1b5.tar.gz libaxl-e911a3182522ee2fc8ee8c03b33029a209e4c1b5.tar.bz2 libaxl-e911a3182522ee2fc8ee8c03b33029a209e4c1b5.tar.xz |
Implement & format token in libaxl_receive
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | common.h | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -102,16 +102,22 @@ struct libaxl_context { char *out_buf; size_t in_buf_size; char *in_buf; + size_t aux_buf_size; + char *aux_buf; }; -#define ALIGN(VP, T)\ +#define ALIGN_VAR(VP, ALIGNMENT)\ do {\ - if (*(VP) & (_Alignof(T) - 1)) {\ - *(VP) |= _Alignof(T) - 1;\ + if (*(VP) & ((ALIGNMENT) - 1)) {\ + *(VP) |= (ALIGNMENT) - 1;\ *(VP) += 1;\ }\ } while (0) +#define ALIGN(VP, T) ALIGN_VAR(VP, _Alignof(T)) + +#define MAX(A, B) ((A) > (B) ? (A) : (B)) + #if INT_MIN + 1 == -INT_MAX # define TWOS_COMPLEMENT8(VP) ((void)0) # define TWOS_COMPLEMENT16(VP) ((void)0) |