xref: /llvm-project/libc/src/stdio/generic/ungetc.cpp (revision 5ff3ff33ff930e4ec49da7910612d8a41eb068cb)
1ddc30ff8SJoseph Huber //===-- Implementation of ungetc ------------------------------------------===//
2ddc30ff8SJoseph Huber //
3ddc30ff8SJoseph Huber // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4ddc30ff8SJoseph Huber // See https://llvm.org/LICENSE.txt for license information.
5ddc30ff8SJoseph Huber // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6ddc30ff8SJoseph Huber //
7ddc30ff8SJoseph Huber //===----------------------------------------------------------------------===//
8ddc30ff8SJoseph Huber 
9ddc30ff8SJoseph Huber #include "src/stdio/ungetc.h"
10ddc30ff8SJoseph Huber #include "src/__support/File/file.h"
11*5ff3ff33SPetr Hosek #include "src/__support/macros/config.h"
12ddc30ff8SJoseph Huber 
135aed6d67SMichael Jones #include "hdr/types/FILE.h"
14ddc30ff8SJoseph Huber 
15*5ff3ff33SPetr Hosek namespace LIBC_NAMESPACE_DECL {
16ddc30ff8SJoseph Huber 
17ddc30ff8SJoseph Huber LLVM_LIBC_FUNCTION(int, ungetc, (int c, ::FILE *stream)) {
18ddc30ff8SJoseph Huber   return reinterpret_cast<LIBC_NAMESPACE::File *>(stream)->ungetc(c);
19ddc30ff8SJoseph Huber }
20ddc30ff8SJoseph Huber 
21*5ff3ff33SPetr Hosek } // namespace LIBC_NAMESPACE_DECL
22