1 //===-- GPU implementation of putchar -------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "src/stdio/putchar.h"
11 #include "src/__support/macros/config.h"
13 #include "hdr/stdio_macros.h" // for EOF and stdout.
15 namespace LIBC_NAMESPACE_DECL
{
17 LLVM_LIBC_FUNCTION(int, putchar
, (int c
)) {
18 unsigned char uc
= static_cast<unsigned char>(c
);
20 size_t written
= file::write(stdout
, &uc
, 1);
27 } // namespace LIBC_NAMESPACE_DECL