Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

baselibc: Fix fflush duplicate error #3121

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions libc/baselibc/include/stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions libc/baselibc/src/mynewt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down