[libc-commits] [libc] [libc][c11] implement ctime (PR #107285)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Wed Sep 4 16:06:58 PDT 2024


=?utf-8?b?0JfQuNGI0LDQvSDQnNC40YDQtw=?=,
=?utf-8?b?0JfQuNGI0LDQvSDQnNC40YDQtw=?=,
=?utf-8?b?0JfQuNGI0LDQvSDQnNC40YDQtw=?=,
=?utf-8?b?0JfQuNGI0LDQvSDQnNC40YDQtw=?=,
=?utf-8?b?0JfQuNGI0LDQvSDQnNC40YDQtw=?=,
=?utf-8?b?0JfQuNGI0LDQvSDQnNC40YDQtw=?=,
=?utf-8?b?0JfQuNGI0LDQvSDQnNC40YDQtw=?=,
=?utf-8?b?0JfQuNGI0LDQvSDQnNC40YDQtw=?=,
=?utf-8?b?0JfQuNGI0LDQvSDQnNC40YDQtw=?=,
=?utf-8?b?0JfQuNGI0LDQvSDQnNC40YDQtw=?Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/107285 at github.com>


================
@@ -145,6 +148,50 @@ LIBC_INLINE char *asctime(const struct tm *timeptr, char *buffer,
   return buffer;
 }
 
+LIBC_INLINE char *ctime(const time_t *t_ptr, char *buffer,
----------------
michaelrj-google wrote:

instead of duplicating this code, it would be simpler to adjust the code in `ctime.cpp` and `ctime_r.cpp` to call `timeutils::asctime(localtime(t_ptr))`

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


More information about the libc-commits mailing list