Skip to content

Commit 97d0806

Browse files
committed
libc: make putc_r implementation weak
newlib provides its own implementation of _putc_r, which will call _write_r (possibly after buffering). Make our implementation weak to allow using the one from newlib. Fixes #4630
1 parent fa67b92 commit 97d0806

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cores/esp8266/libc_replacements.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ int ICACHE_RAM_ATTR _write_r(struct _reent* r, int file, char *ptr, int len) {
9393
return len;
9494
}
9595

96+
int ICACHE_RAM_ATTR _putc_r(struct _reent* r, int c, FILE* file) __attribute__((weak));
97+
9698
int ICACHE_RAM_ATTR _putc_r(struct _reent* r, int c, FILE* file) {
9799
(void) r;
98100
if (file->_file == STDOUT_FILENO) {

0 commit comments

Comments
 (0)