From 0348e24bab24cc46642d29e3ceab64df22553298 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 9 Jan 2023 06:15:55 -0800 Subject: replace time64 functions with normal ones (#1830) Otherwise there are 32/64-bit pointer conversions going on. In Windows since MSVC2005, time_t has been 64-bit. MinGW needs a hack to get 64-bit time_t. Signed-off-by: Rosen Penev Signed-off-by: Rosen Penev --- cpio/cpio.c | 6 +++--- cpio/test/test_option_t.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'cpio') diff --git a/cpio/cpio.c b/cpio/cpio.c index de0144fa..f2d83d94 100644 --- a/cpio/cpio.c +++ b/cpio/cpio.c @@ -1153,7 +1153,7 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry) time_t mtime; static time_t now; struct tm *ltime; -#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S) +#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S) struct tm tmbuf; #endif @@ -1203,8 +1203,8 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry) else fmt = cpio->day_first ? "%e %b %H:%M" : "%b %e %H:%M"; #endif -#if defined(HAVE__LOCALTIME64_S) - ltime = _localtime64_s(&tmbuf, &mtime) ? NULL : &tmbuf; +#if defined(HAVE_LOCALTIME_S) + ltime = localtime_s(&tmbuf, &mtime) ? NULL : &tmbuf; #elif defined(HAVE_LOCALTIME_R) ltime = localtime_r(&mtime, &tmbuf); #else diff --git a/cpio/test/test_option_t.c b/cpio/test/test_option_t.c index 52bcff52..9eef0da5 100644 --- a/cpio/test/test_option_t.c +++ b/cpio/test/test_option_t.c @@ -37,7 +37,7 @@ DEFINE_TEST(test_option_t) char date[32]; char date2[32]; struct tm *tmptr; -#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S) +#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S) struct tm tmbuf; #endif @@ -91,8 +91,8 @@ DEFINE_TEST(test_option_t) #ifdef HAVE_LOCALE_H setlocale(LC_ALL, ""); #endif -#if defined(HAVE__LOCALTIME64_S) - tmptr = _localtime64_s(&tmbuf, &mtime) ? NULL : &tmbuf; +#if defined(HAVE_LOCALTIME_S) + tmptr = localtime_s(&tmbuf, &mtime) ? NULL : &tmbuf; #elif defined(HAVE_LOCALTIME_R) tmptr = localtime_r(&mtime, &tmbuf); #else -- cgit v1.2.1