diff --git a/src/file.cpp b/src/file.cpp index 333749d30..a6ef862ed 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -651,7 +651,10 @@ static_assert(!(open_mode::sparse & open_mode::attribute_mask), "internal flags if ((mode & open_mode::random_access)) { // disable read-ahead - ::posix_fadvise(native_handle(), 0, 0, POSIX_FADV_RANDOM); + // NOTE: in android this function was introduced in API 21, + // but the constant POSIX_FADV_RANDOM is there for lower + // API levels, just don't add :: to allow a macro workaround + posix_fadvise(native_handle(), 0, 0, POSIX_FADV_RANDOM); } #endif