<p></p>
<p dir="auto"><a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/rdipardo/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/rdipardo">@rdipardo</a> thanks for working on this.</p>
<p dir="auto">Sorry I wasn't precise enough, need to keep the compile time check <em>and</em> add the default runtime check for newer.</p>
<p dir="auto">Basically the idea should be to get logic like:</p>
<pre><code>if compiled against a new enough version and the runtime version is same or newer (the glib_check_version)
then use microseconds 
else use seconds
</code></pre>
<p dir="auto">That ensures the <code>(null)</code> doesn't happen by being conservative about which runtime versions are compatible rather than providing microseconds on every system where it is possible.  Whilst the microseconds can be useful, we got by without until now, so IMHO its not critical to provide it, but it is critical to always get a time. (<a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/eht16/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/eht16">@eht16</a> agree?)</p>
<p dir="auto">A hackier alternative is to simply try <code>g_date_time_format()</code> with <code>%f</code> and if it returns <code>NULL</code> try without.</p>
<p dir="auto">Just a comment to the world, Geany doesn't do a general <code>glib_check_version()</code>.  I'm not sure if its deliberate or if its just nobody ever did it, but its a good thing because it allows Geany compiled against a newer Glib to be run on a machine with an older glib, whereas the <code>glib_check_version()</code> can only approve a same or newer version since it doesn't know which functions an application uses and has to assume the ones just added to this version.  Of course distros package management restrictions and Windows and OSX having bundled Glib means its unusual to have a mismatch between compile and runtime Glibs so the fact that Geany does not check does no harm in most cases, but allows it if the user wants to try, for example with nightly builds. Sure it might not work, but the dynamic linker should fail if a function is missing so no harm done.</p>
<p dir="auto">This case gets complicated because we want to provide a workaround, not fail, and the incompatibility is just the contents of a string not a missing function so its really hidden.</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-1002812481">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ5GJ4J43ZQE63TSU4DUTOKTJANCNFSM5KZRW7CQ">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/AAIOWJ6JRXJSD6ZQKLFYQ63UTOKTJA5CNFSM5KZRW7C2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHPC3IQI.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/1002812481</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-1002812481",
"url": "https://github.com/geany/geany/issues/3071#issuecomment-1002812481",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>