Merge "Put the legacy stdio fds back for pre-M."

This commit is contained in:
Treehugger Robot 2016-07-15 21:33:00 +00:00 committed by Gerrit Code Review
commit 098d8ef5b2
1 changed files with 10 additions and 0 deletions

View File

@ -55,13 +55,23 @@ typedef off64_t fpos64_t;
struct __sFILE; struct __sFILE;
typedef struct __sFILE FILE; typedef struct __sFILE FILE;
#if __ANDROID_API__ >= 23
extern FILE* stdin __INTRODUCED_IN(23); extern FILE* stdin __INTRODUCED_IN(23);
extern FILE* stdout __INTRODUCED_IN(23); extern FILE* stdout __INTRODUCED_IN(23);
extern FILE* stderr __INTRODUCED_IN(23); extern FILE* stderr __INTRODUCED_IN(23);
/* C99 and earlier plus current C++ standards say these must be macros. */ /* C99 and earlier plus current C++ standards say these must be macros. */
#define stdin stdin #define stdin stdin
#define stdout stdout #define stdout stdout
#define stderr stderr #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 * The following three definitions are for ANSI C, which took them