From c02f2e128d874da901c1f2466e3887e2a6b0fd1e Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 23 Oct 2022 10:34:49 +0200 Subject: [PATCH] libc: Stub out ungetc() --- libs/libc/include/stdio.h | 2 ++ libs/libc/src/file.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/libs/libc/include/stdio.h b/libs/libc/include/stdio.h index 72755dda..853fd4df 100644 --- a/libs/libc/include/stdio.h +++ b/libs/libc/include/stdio.h @@ -98,6 +98,8 @@ extern "C" /* Retrieves a character from stream. */ int getc(FILE* stream); + int ungetc(int, FILE*); // Not implemented. + /* Retrieves a character from standard input. */ int getchar(); diff --git a/libs/libc/src/file.cpp b/libs/libc/src/file.cpp index 2ce93106..74507216 100644 --- a/libs/libc/src/file.cpp +++ b/libs/libc/src/file.cpp @@ -170,6 +170,11 @@ extern "C" return fgetc(stdin); } + int ungetc(int, FILE*) + { + NOT_IMPLEMENTED("ungetc"); + } + int ferror(FILE* stream) { return stream->f_err;