aboutsummaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2023-02-12 17:14:23 -0500
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-02-13 00:42:36 +0100
commita391c8f0eef8573fd6b99e6cd264a5f2caa539cb (patch)
tree4e0835b958dcd51a59ab5a1bf652dec4ea2c544a /utils.h
parent403007dc55222d4ca1120dd7730baa7579d12d88 (diff)
downloadmig-a391c8f0eef8573fd6b99e6cd264a5f2caa539cb.tar.gz
mig-a391c8f0eef8573fd6b99e6cd264a5f2caa539cb.tar.bz2
mig-a391c8f0eef8573fd6b99e6cd264a5f2caa539cb.zip
Introduce complex_alignof to replace word_size
Remove the concept of word_size since it is meaningless in some architectures. This is also done in preparation to possibly introduce 8-byte aligned messages. Message-Id: <Y+lkv0uMo/3+hbCb@jupiter.tail36e24.ts.net>
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/utils.h b/utils.h
index 4be4f4c..477ea74 100644
--- a/utils.h
+++ b/utils.h
@@ -39,6 +39,8 @@
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _b : _a; })
+#define ALIGN(x, alignment) \
+ ((x) + (alignment)-1) & ~((alignment)-1)
typedef void write_list_fn_t(FILE *file, const argument_t *arg);