don't access dlclose'd dynamic ioengine object after close
[fio.git] / compiler / compiler.h
index 8a784b9269b6a66419fc7f51cb453f047309653f..44fa87b90cf8c5959ec76c8544aa90480b89f318 100644 (file)
 #endif
 
 #ifdef FIO_INTERNAL
-#define ARRAY_SIZE(x)    (sizeof((x)) / (sizeof((x)[0])))
-#define FIELD_SIZE(s, f) (sizeof(((__typeof__(s))0)->f))
+#define FIO_ARRAY_SIZE(x)    (sizeof((x)) / (sizeof((x)[0])))
+#define FIO_FIELD_SIZE(s, f) (sizeof(((__typeof__(s))0)->f))
+#endif
+
+#ifndef __has_attribute
+#define __GCC4_has_attribute___fallthrough__   0
+#endif
+
+#if __has_attribute(__fallthrough__)
+#define fallthrough     __attribute__((__fallthrough__))
+#else
+#define fallthrough    do {} while (0)  /* fallthrough */
 #endif
 
 #endif