diff --git a/libc/baselibc/include/stdio.h b/libc/baselibc/include/stdio.h index d941ab4c16..adfaaf417b 100644 --- a/libc/baselibc/include/stdio.h +++ b/libc/baselibc/include/stdio.h @@ -97,10 +97,7 @@ __extern_inline int putchar(int c) #define getc(f) fgetc(f) #define getchar() fgetc(stdin) -__extern_inline int fflush(FILE *stream) -{ - return 0; -} +__extern int fflush(FILE *stream); __extern int printf(const char *, ...); __extern int vprintf(const char *, va_list); diff --git a/libc/baselibc/src/mynewt.c b/libc/baselibc/src/mynewt.c index 99b4513357..a8f12ee7de 100644 --- a/libc/baselibc/src/mynewt.c +++ b/libc/baselibc/src/mynewt.c @@ -48,6 +48,12 @@ struct File *const stdin = &_stdin; struct File *const stdout = &_stdin; struct File *const stderr = &_stdin; +int __attribute__((weak)) +fflush(FILE *stream) +{ + return 0; +} + #if MYNEWT_VAL(BASELIBC_THREAD_SAFE_HEAP_ALLOCATION) static struct os_mutex heap_mutex;