diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2023-05-02 10:27:31 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2023-05-02 10:27:31 +0200 |
commit | 63ea8f1a2a603c356ad770ae7567246e7520f298 (patch) | |
tree | 78463901e35500e52ea2b280a7462f1b88d5e682 /config.h.meson.in | |
parent | 0619c65273da0ca2644e43596fe3d61c1d8b0737 (diff) | |
download | tracker-63ea8f1a2a603c356ad770ae7567246e7520f298.tar.gz |
build: Detect appropriate strftime() year modifier at build time
Different libc implementations (or different platforms) have different
bugs. Even though %Y is documented as a 4-digit number, and %C as
year/100 in a [00-99] range, they both crap out with years under 1000,
using respectively 3 and 1 digits.
This would be typically task for a width modifier (e.g. %4Y, or %2C),
but that was conversely found to break NixOS on Darwin.
Since the existing libc bugs paint us to a corner, detect an
appropriate modifier at build time to get a 4-digit year to get true
ISO 8601 in our supported [0001-9999] year range.
Closes: https://gitlab.gnome.org/GNOME/tracker/-/issues/402
Diffstat (limited to 'config.h.meson.in')
-rw-r--r-- | config.h.meson.in | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/config.h.meson.in b/config.h.meson.in index df4b880b0..2faa1a586 100644 --- a/config.h.meson.in +++ b/config.h.meson.in @@ -51,3 +51,6 @@ /* Whether RTLD_NOLOAD is defined */ #mesondefine HAVE_RTLD_NOLOAD + +/* Appropriate 4-digit year modifier for strftime() */ +#mesondefine STRFTIME_YEAR_MODIFIER |