Declare global __sf[] only once

Reduced number of global __sf[] declarations from two to one,
simplifying initializations in sys/reent.h.
This commit is contained in:
Sebastian Huber 2022-05-02 09:25:44 +02:00
parent 92896d4daa
commit d041db3792
1 changed files with 4 additions and 2 deletions

View File

@ -293,6 +293,10 @@ typedef struct __sFILE __FILE;
#endif /* __LARGE64_FILES */
#endif /* !__CUSTOM_FILE_IO__ */
#ifdef _REENT_GLOBAL_STDIO_STREAMS
extern __FILE __sf[3];
#endif
struct _glue
{
struct _glue *_next;
@ -426,7 +430,6 @@ struct _reent
};
#ifdef _REENT_GLOBAL_STDIO_STREAMS
extern __FILE __sf[3];
# define _REENT_INIT(var) \
{ 0, \
@ -698,7 +701,6 @@ struct _reent
};
#ifdef _REENT_GLOBAL_STDIO_STREAMS
extern __FILE __sf[3];
#define _REENT_STDIO_STREAM(var, index) &__sf[index]
#else
#define _REENT_STDIO_STREAM(var, index) &(var)->__sf[index]