Skip to content

Commit

Permalink
fixup! sys/stdio: add common stdio module
Browse files Browse the repository at this point in the history
  • Loading branch information
benpicco committed Feb 9, 2024
1 parent 796b633 commit 7d91af4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sys/stdio/stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,13 @@ void stdio_close(void) {
}
}
}

#define MAYBE_WEAK
#else
#define MAYBE_WEAK __attribute__((weak))
#endif

MAYBE_WEAK
ssize_t stdio_read(void* buffer, size_t len)
{
if (!IS_USED(MODULE_STDIN)) {
Expand All @@ -67,6 +72,7 @@ ssize_t stdio_read(void* buffer, size_t len)
}

#if IS_USED(MODULE_STDIO_AVAILABLE)
MAYBE_WEAK
int stdio_available(void)
{
return tsrb_avail(&stdin_isrpipe.tsrb);
Expand Down

0 comments on commit 7d91af4

Please sign in to comment.