projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
add FIELD_SIZE macro to calculate the size of the specified field
[fio.git]
/
fio.h
diff --git
a/fio.h
b/fio.h
index 53d82560053ba95ab768f1aedc78f6275a780233..a00e8f23000c6450b5e636868602556c0057c35d 100644
(file)
--- 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 {