Reverts https://github.com/GNOME/tracker/commit/63ea8f1a2a603c356ad770ae7567246e7520f298 --- meson.build 2024-05-02 21:11:35.000000000 +0800 +++ meson.build 2024-06-10 09:26:04.000000000 +0800 @@ -207,41 +207,6 @@ endif ################################################################## -# Get an appropriate 4-digit year modifier for strftime -################################################################## -result = cc.run(''' - #define _TIME_BITS 64 - #define _GNU_SOURCE - #include - #include - #include - - int main (int argc, char *argv[]) { - char *modifiers[] = { "%Y", "%C%y", "%4Y", "%2C%y", NULL }; - time_t timestamp = -58979923200; /* 0101-01-01T01:01:01Z */ - char buf[100]; - struct tm tm; - int i; - gmtime_r (×tamp, &tm); - for (i = 0; modifiers[i]; i++) { - strftime (buf, sizeof buf, modifiers[i], &tm); - if (strcmp (buf, "0101") == 0) { - printf ("%s", modifiers[i]); - return 0; - } - } - return -1; - } - ''', - name: 'strftime 4-digit year modifier') - -if not result.compiled() or result.returncode() != 0 - error('Libc implementation has broken 4-digit years implementation.') -else - year_modifier = result.stdout() -endif - -################################################################## # Check for libtracker-data and libtracker-fts: Unicode support # # By default, AUTO with this order of preference: @@ -350,7 +315,6 @@ conf.set('TRACKER_MICRO_VERSION', tracker_micro_version) conf.set('TRACKER_INTERFACE_AGE', 0) conf.set('TRACKER_BINARY_AGE', 100 * tracker_minor_version + tracker_micro_version) -conf.set('STRFTIME_YEAR_MODIFIER', '"@0@"'.format(year_modifier)) # Check for RTLD_NOLOAD have_rtld_noload = cc.has_header_symbol('dlfcn.h', 'RTLD_NOLOAD') @@ -441,7 +405,6 @@ ' Debug: ' + get_option('debug').to_string(), ' Optimization: ' + get_option('optimization'), ' Compiler: ' + cc.get_id(), - ' 4-digit strftime() year modifier: ' + year_modifier, '\nFeature Support:', ' Unicode support library: ' + unicode_library_name, ' Build with Stemming support: ' + have_libstemmer.to_string(), --- src/libtracker-sparql/core/tracker-db-interface-sqlite.c 2024-05-02 21:11:35.000000000 +0800 +++ src/libtracker-sparql/core/tracker-db-interface-sqlite.c 2024-06-10 09:26:57.000000000 +0800 @@ -1542,9 +1542,9 @@ result_context_function_error (context, fn, "Invalid unix timestamp"); if (prop_type == TRACKER_PROPERTY_TYPE_DATETIME) - retval = strftime ((gchar *) &buf, sizeof (buf), STRFTIME_YEAR_MODIFIER "-%m-%dT%TZ", &tm); + retval = strftime ((gchar *) &buf, sizeof (buf), "%2C%y-%m-%dT%TZ", &tm); else if (prop_type == TRACKER_PROPERTY_TYPE_DATE) - retval = strftime ((gchar *) &buf, sizeof (buf), STRFTIME_YEAR_MODIFIER "-%m-%d", &tm); + retval = strftime ((gchar *) &buf, sizeof (buf), "%2C%y-%m-%d", &tm); else g_assert_not_reached ();