[libc-commits] [libc] [libc] Add getc, ungetc, fflush to enable libc++ iostream on baremetal (PR #175530)

Volodymyr Turanskyy via libc-commits libc-commits at lists.llvm.org
Tue Jan 13 08:50:27 PST 2026


================
@@ -0,0 +1,18 @@
+//===-- Implementation of getc for baremetal -------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/stdio/getc.h"
+#include "src/stdio/fgetc.h"
+
+#include "src/__support/common.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(int, getc, (::FILE * stream)) { return fgetc(stream); }
----------------
voltur01 wrote:

Make sense, thank you - updated.

https://github.com/llvm/llvm-project/pull/175530


More information about the libc-commits mailing list