1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/picolibc_syscalls_default: make stdin and stderr strong refs

This commit is contained in:
Kaspar Schleiser 2021-10-20 11:21:57 +02:00
parent 0486c0dba7
commit b651b29751

View File

@ -236,9 +236,18 @@ FILE picolibc_stdio =
FDEV_SETUP_STREAM(picolibc_put, picolibc_get, picolibc_flush, _FDEV_SETUP_RW);
#ifdef PICOLIBC_STDIO_GLOBALS
FILE *const stdout = &picolibc_stdio;
#ifdef __strong_reference
/* This saves two const pointers.
* See https://github.com/RIOT-OS/RIOT/pull/17001#issuecomment-945936918
*/
#define STDIO_ALIAS(x) __strong_reference(stdin, x);
#else
#define STDIO_ALIAS(x) FILE *const x = &__picolibc_stdio;
#endif
FILE *const stdin = &picolibc_stdio;
FILE *const stderr = &picolibc_stdio;
STDIO_ALIAS(stdout);
STDIO_ALIAS(stderr);
#else
FILE *const __iob[] = {
&picolibc_stdio, /* stdin */