removed leading :: in posix_fadvise to allow for fix in old android API build (#2341)

This commit is contained in:
Alden Torres 2017-09-16 07:47:49 -04:00 committed by Arvid Norberg
parent 87832ce706
commit 582d9dfc24
1 changed files with 4 additions and 1 deletions

View File

@ -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