[libc-commits] [libc] [libc] Add strftime_l (PR #127767)

Petr Hosek via libc-commits libc-commits at lists.llvm.org
Thu Feb 20 18:33:58 PST 2025


================
@@ -0,0 +1,33 @@
+//===-- Implementation of strftime_l 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/strftime_l.h"
+#include "hdr/types/size_t.h"
+#include "hdr/types/struct_tm.h"
+#include "include/llvm-libc-types/locale_t.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+#include "src/stdio/printf_core/writer.h"
+#include "src/time/strftime_core/strftime_main.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+// TODO: Add support for locales.
+LLVM_LIBC_FUNCTION(size_t, strftime_l,
+                   (char *__restrict buffer, size_t buffsz,
+                    const char *__restrict format,
+                    const struct tm *__restrict tp, locale_t)) {
----------------
petrhosek wrote:

Done.

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


More information about the libc-commits mailing list