From 32c79c279d8d06163c8ee3e013007bebe3ff62ba Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Fri, 15 Jul 2016 11:32:23 -0700 Subject: [PATCH] Put the legacy stdio fds back for pre-M. Change-Id: I2e397b04cba2969b9f9a3767b9b2fd12a289fcd2 --- libc/include/stdio.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libc/include/stdio.h b/libc/include/stdio.h index 3e666d4ed..621caa84e 100644 --- a/libc/include/stdio.h +++ b/libc/include/stdio.h @@ -55,13 +55,23 @@ typedef off64_t fpos64_t; struct __sFILE; typedef struct __sFILE FILE; +#if __ANDROID_API__ >= 23 extern FILE* stdin __INTRODUCED_IN(23); extern FILE* stdout __INTRODUCED_IN(23); extern FILE* stderr __INTRODUCED_IN(23); + /* C99 and earlier plus current C++ standards say these must be macros. */ #define stdin stdin #define stdout stdout #define stderr stderr +#else +/* Before M the actual symbols for stdin and friends had different names. */ +extern FILE* __sF[] __REMOVED_IN(23); + +#define stdin __sF[0] +#define stdout __sF[1] +#define stderr __sF[2] +#endif /* * The following three definitions are for ANSI C, which took them