From 582d9dfc24f78c875313ca20c4fd48f37aa2b43d Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Sat, 16 Sep 2017 07:47:49 -0400 Subject: [PATCH] removed leading :: in posix_fadvise to allow for fix in old android API build (#2341) --- src/file.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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