aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2020-06-21 12:05:31 +0200
committerMattias Andrée <maandree@kth.se>2020-06-21 12:05:31 +0200
commite911a3182522ee2fc8ee8c03b33029a209e4c1b5 (patch)
tree7ce8bc3760571b1f7accfcb3cf9b3c19552f9efa /common.h
parentAdd LIBAXL_SYNTHETIC_EVENT_BIT (diff)
downloadlibaxl-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.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/common.h b/common.h
index e0330cb..412a45f 100644
--- a/common.h
+++ b/common.h
@@ -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)