From 71deafc693ad77947f5c3f72e7247eefcb97bd63 Mon Sep 17 00:00:00 2001 From: Roman Pen Date: Wed, 19 Aug 2015 12:33:10 +0200 Subject: [PATCH] add FIELD_SIZE macro to calculate the size of the specified field Will use this stuff later. Signed-off-by: Roman Pen Signed-off-by: Jens Axboe --- fio.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fio.h b/fio.h index 53d82560..a00e8f23 100644 --- a/fio.h +++ b/fio.h @@ -668,7 +668,8 @@ extern const char *fio_get_arch_string(int); extern const char *fio_get_os_string(int); #ifdef FIO_INTERNAL -#define ARRAY_SIZE(x) (sizeof((x)) / (sizeof((x)[0]))) +#define ARRAY_SIZE(x) (sizeof((x)) / (sizeof((x)[0]))) +#define FIELD_SIZE(s, f) (sizeof(((typeof(s))0)->f)) #endif enum { -- 2.25.1