[RFC 5/6] add FIELD_SIZE macro to calculate the size of the specified field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Will use this stuff later.

Signed-off-by: Roman Pen <r.peniaev@xxxxxxxxx>
---
 fio.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fio.h b/fio.h
index 17bc02b..ab858fa 100644
--- a/fio.h
+++ b/fio.h
@@ -667,7 +667,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.4.4

--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux