Skip to content

Commit b4a34e5

Browse files
maribucrasbe
andcommitted
sys/picolibc_syscalls_default: fix linking with 1.8.10+
This adapts to an API change for providing stdin/stdout/stderr: The macro to test whether globals are to be used is now prefixed with two underscores. Co-authored-by: crasbe <[email protected]>
1 parent 7cfa01e commit b4a34e5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sys/picolibc_syscalls_default/syscalls.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,9 @@ static int picolibc_get(FILE *file)
238238
FILE picolibc_stdio =
239239
FDEV_SETUP_STREAM(picolibc_put, picolibc_get, picolibc_flush, _FDEV_SETUP_RW);
240240

241-
#ifdef PICOLIBC_STDIO_GLOBALS
241+
/* Since picolibc 1.8.10, PICOLIBC_STDIO_GLOBALS is prefixed with two leading
242+
* underscores. We just test for both to remain backwards compatible */
243+
#if defined(PICOLIBC_STDIO_GLOBALS) || defined(__PICOLIBC_STDIO_GLOBALS)
242244
#ifdef __strong_reference
243245
/* This saves two const pointers.
244246
* See https://github.com/RIOT-OS/RIOT/pull/17001#issuecomment-945936918

0 commit comments

Comments
 (0)