<p></p>
<blockquote>
<p dir="auto">I said test availability at runtime.</p>
</blockquote>
<p dir="auto">There's <code>glib_check_version()</code>, although the spec makes it sound like the target is supposed to be the same version as your own development library (*).</p>
<div class="highlight highlight-source-diff"><pre><span class="pl-c1">diff --git a/src/utils.c b/src/utils.c</span>
index 6f7cb5b0..ecd2c3eb 100644
<span class="pl-md">--- a/src/utils.c</span>
<span class="pl-mi1">+++ b/src/utils.c</span>
<span class="pl-mdr">@@ -1050,7 +1050,8 @@</span> gint utils_parse_color_to_bgr(const gchar *spec)
 gchar *utils_get_current_time_string(gboolean include_microseconds)
 {
        GDateTime *now = g_date_time_new_now_local();
<span class="pl-md"><span class="pl-md">-</span>  const gchar *format = include_microseconds ? "%H:%M:%S.%f" : "%H:%M:%S";</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>        const gboolean have_f_time_fmt_spec = (glib_check_version(2, 65, 2) == NULL);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>        const gchar *format = (have_f_time_fmt_spec && include_microseconds) ? "%H:%M:%S.%f" : "%H:%M:%S";</span>
        gchar *time_string = g_date_time_format(now, format);
        g_date_time_unref(now);
        return time_string;</pre></div>
<hr>
<p dir="auto">(*)</p>
<blockquote>
<p dir="auto">Generally you would pass in the constants GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION as the three arguments to this function; that produces a check that the library in use is compatible with the version of GLib the application or module was compiled against.</p>
</blockquote>
<p dir="auto"><a href="https://developer-old.gnome.org/glib/stable/glib-Version-Information.html#glib-check-version" rel="nofollow">https://developer-old.gnome.org/glib/stable/glib-Version-Information.html#glib-check-version</a></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/3071#issuecomment-1002798586">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ2ZOQ7TTOPEJ6VTKXLUTODR7ANCNFSM5KZRW7CQ">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAIOWJ4XN3BWMT7ZPUQCX3DUTODR7A5CNFSM5KZRW7C2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHPCX36Q.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><geany/geany/issues/3071/1002798586</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/3071#issuecomment-1002798586",
"url": "https://github.com/geany/geany/issues/3071#issuecomment-1002798586",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>