* src/extent-scan.c (extent_scan_read): Adjust to change in
struct fiemap.
* src/fiemap.h (struct fiemap): Use FLEXIBLE_ARRAY_MEMBER
to port to C99.
union { struct fiemap f; char c[4096]; } fiemap_buf;
struct fiemap *fiemap = &fiemap_buf.f;
struct fiemap_extent *fm_extents = &fiemap->fm_extents[0];
- enum { count = (sizeof fiemap_buf - sizeof *fiemap)/sizeof *fm_extents };
+ enum { headersize = offsetof (struct fiemap, fm_extents) };
+ enum { count = (sizeof fiemap_buf - headersize) / sizeof *fm_extents };
verify (count > 1);
/* This is required at least to initialize fiemap->fm_start,
uint32_t fm_reserved;
- /* Array of mapped extents(out).
- This is protected by the ifdef because it uses non standard
- zero length arrays. Note C99 has the equivalent flexible arrays,
- but we don't use those for maximum portability to older systems. */
-# ifdef __linux__
- struct fiemap_extent fm_extents[0];
-# endif
+ /* Array of mapped extents(out). */
+ struct fiemap_extent fm_extents[FLEXIBLE_ARRAY_MEMBER];
};
/* The maximum offset can be mapped for a file. */