Files
clang-p2996/libc/src/time/asctime.cpp
Michael Jones 1c92911e9e [libc] apply new lint rules
This patch applies the lint rules described in the previous patch. There
was also a significant amount of effort put into manually fixing things,
since all of the templated functions, or structs defined in /spec, were
not updated and had to be handled manually.

Reviewed By: sivachandra, lntue

Differential Revision: https://reviews.llvm.org/D114302
2021-12-07 10:49:47 -08:00

23 lines
775 B
C++

//===-- Implementation of asctime function --------------------------------===//
//
// 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/time/asctime.h"
#include "src/__support/common.h"
#include "src/time/time_utils.h"
namespace __llvm_libc {
using __llvm_libc::time_utils::TimeConstants;
LLVM_LIBC_FUNCTION(char *, asctime, (const struct tm *timeptr)) {
static char buffer[TimeConstants::ASCTIME_BUFFER_SIZE];
return time_utils::asctime(timeptr, buffer, TimeConstants::ASCTIME_MAX_BYTES);
}
} // namespace __llvm_libc