@rdipardo thanks for working on this.

Sorry I wasn't precise enough, need to keep the compile time check and add the default runtime check for newer.

Basically the idea should be to get logic like:

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

That ensures the (null) 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. (@eht16 agree?)

A hackier alternative is to simply try g_date_time_format() with %f and if it returns NULL try without.

Just a comment to the world, Geany doesn't do a general glib_check_version(). 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 glib_check_version() 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.

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.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany/issues/3071/1002812481@github.com>