From fed07e876967eecf7489dd67e3e80dc7bb7a6f7c Mon Sep 17 00:00:00 2001 From: Phillip Berndt Date: Tue, 2 Jan 2024 11:39:25 +0100 Subject: [PATCH] Switch to 64 bit time formatting for sorting Fixes #194 --- pqiv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pqiv.c b/pqiv.c index 59f849b..aec4456 100644 --- a/pqiv.c +++ b/pqiv.c @@ -1769,9 +1769,10 @@ void load_images_handle_parameter(char *param, load_images_state_t state, gint d if(param_file) { GFileInfo *file_info = g_file_query_info(param_file, G_FILE_ATTRIBUTE_TIME_MODIFIED, G_FILE_QUERY_INFO_NONE, NULL, NULL); if(file_info) { -#if GLIB_CHECK_VERSION(2, 62, 0) +#if GLIB_CHECK_VERSION(2, 62, 0) && !defined(_WIN32) + // Note: _WIN32 check might not be needed, G_GINT64_FORMAT used to be unsupported in MingW GDateTime *result = g_file_info_get_modification_date_time(file_info); - file->sort_name = g_strdup_printf("%zu;%s", g_date_time_to_unix(result), file->display_name); + file->sort_name = g_strdup_printf("%" G_GINT64_FORMAT ";%s", g_date_time_to_unix(result), file->display_name); g_date_time_unref(result); #else GTimeVal result;