[geany/geany] bb955d: Use microseconds for log dates only if supported
Enrico Tröger
git-noreply at xxxxx
Sun Jan 9 13:16:43 UTC 2022
Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger at uvena.de>
Committer: Enrico Tröger <enrico.troeger at uvena.de>
Date: Sun, 09 Jan 2022 13:16:43 UTC
Commit: bb955d0db773ec833859449c5adcc19e488b3afd
https://github.com/geany/geany/commit/bb955d0db773ec833859449c5adcc19e488b3afd
Log Message:
-----------
Use microseconds for log dates only if supported
Fixes #3071.
Modified Paths:
--------------
src/utils.c
Modified: src/utils.c
4 lines changed, 4 insertions(+), 0 deletions(-)
===================================================================
@@ -1049,6 +1049,10 @@ gint utils_parse_color_to_bgr(const gchar *spec)
* The returned string should be freed with g_free(). */
gchar *utils_get_current_time_string(gboolean include_microseconds)
{
+ // "%f" specifier for microseconds is only available since GLib 2.66
+ if (glib_check_version(2, 66, 0) != NULL)
+ include_microseconds = FALSE;
+
GDateTime *now = g_date_time_new_now_local();
const gchar *format = include_microseconds ? "%H:%M:%S.%f" : "%H:%M:%S";
gchar *time_string = g_date_time_format(now, format);
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Commits
mailing list