From 79a3db030475792f8ee355292235d3453f50db65 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 17 Mar 2017 18:56:08 -0700 Subject: [PATCH] Only rename fgetpos/fsetpos/fseeko/ftello/funopen if we're N or newer. Without this, setting __FILE_OFFSET_BITS to 64 and targeting pre-L made these functions entirely unavailable. Bug: https://github.com/android-ndk/ndk/issues/333 Test: builds Change-Id: Id17ae3c070f8b2650a9bc9aa2aa2e92c5fcdf4ad --- libc/include/stdio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/include/stdio.h b/libc/include/stdio.h index 7d63fa4ca..8b0e9dfb4 100644 --- a/libc/include/stdio.h +++ b/libc/include/stdio.h @@ -176,7 +176,7 @@ int renameat(int, const char*, int, const char*); int fseek(FILE*, long, int); long ftell(FILE*); -#if defined(__USE_FILE_OFFSET64) +#if defined(__USE_FILE_OFFSET64) && __ANDROID_API__ >= __ANDROID_API_N__ int fgetpos(FILE*, fpos_t*) __RENAME(fgetpos64); int fsetpos(FILE*, const fpos_t*) __RENAME(fsetpos64); int fseeko(FILE*, off_t, int) __RENAME(fseeko64); -- 2.11.0