Make code compatible with picolibc >= 1.7.3

picolibc commit 1eba3461fd1664d38be36f3bf21898f889a7d2e3 changed
the way how stdio backends are used by picolibc.  Let's use the
PICOLIBC_STDIO_GLOBALS to differentiate the old vs. new method.

Closes: SYS#6042
This commit is contained in:
Harald Welte 2022-07-11 17:56:55 +02:00
parent 63c07a8bd1
commit cbff8e75d0
1 changed files with 6 additions and 1 deletions

View File

@ -95,8 +95,13 @@ static FILE __stdin = FDEV_SETUP_STREAM(NULL, my_stdin_getc, NULL, _FDEV_SETUP_R
static FILE __stdout = FDEV_SETUP_STREAM(my_stdout_putc, NULL, my_stdout_flush, _FDEV_SETUP_WRITE); static FILE __stdout = FDEV_SETUP_STREAM(my_stdout_putc, NULL, my_stdout_flush, _FDEV_SETUP_WRITE);
static FILE __stderr = FDEV_SETUP_STREAM(my_stderr_putc, NULL, NULL, _FDEV_SETUP_WRITE); static FILE __stderr = FDEV_SETUP_STREAM(my_stderr_putc, NULL, NULL, _FDEV_SETUP_WRITE);
#ifndef PICOLIBC_STDIO_GLOBALS
FILE *const __iob[3] = { &__stdin, &__stdout, &__stderr }; FILE *const __iob[3] = { &__stdin, &__stdout, &__stderr };
#else
FILE *const stdin = &__stdin;
FILE *const stdout = &__stdout;
FILE *const stderr = &__stderr;
#endif
#include <libcommon/microvty.h> #include <libcommon/microvty.h>