--- block/file-posix.c.orig +++ block/file-posix.c @@ -1851,7 +1851,9 @@ ret = do_fallocate(s->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, aiocb->aio_offset, aiocb->aio_nbytes); ret = translate_err(ret); -#elif defined(__APPLE__) && (__MACH__) +#elif defined(__APPLE__) && (__MACH__) && \ + defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && \ + __MAC_OS_X_VERSION_MAX_ALLOWED >= 101204 fpunchhole_t fpunchhole; fpunchhole.fp_flags = 0; fpunchhole.reserved = 0;