[libc-commits] [libc] [libc] Add `ctime_s` (PR #110676)
Nick Desaulniers via libc-commits
libc-commits at lists.llvm.org
Wed Jan 8 11:05:19 PST 2025
================
@@ -0,0 +1,45 @@
+//===-- Implementation of ctime_s 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
+//
+//===----------------------------------------------------------------------===//
+
+#define __STDC_WANT_LIB_EXT1__ 1
+
+#include "ctime_s.h"
+#include "hdr/errno_macros.h"
----------------
nickdesaulniers wrote:
```suggestion
#include "hdr/errno_macros.h"
#include "hdr/types/errno_t.h"
#include "hdr/types/rsize_t.h"
```
but make sure to sort those alphabetically (I think they're fine).
It's good to have direct includes in C & C++, such that refactoring headers is simpler, since you don't have to fix indirect or "transitive" dependencies.
https://github.com/llvm/llvm-project/pull/110676
More information about the libc-commits
mailing list