hughsie / colord

Making color management just work
GNU General Public License v2.0
75 stars 51 forks source link

meson.build: use 64-bit time_t #158

Closed thesamesam closed 12 months ago

thesamesam commented 12 months ago

We call gmtime_r (which expects time_t) with a 64-bit pointer (gint64*).

On 32-bit systems, time_t is 32-bit unless you opt-in to a 64-bit wide version (at least on glibc). To avoid truncation and -Wincompatible-pointer-types, opt-in to 64-bit time_t for glibc with -D_TIME_BITS=64 in meson.

This should be fine ABI wise because the time is only passed down into lcms2 into _cmsEncodeDateTimeNumber where it seems to decompose it and it worked already for 64-bit systems. Plus, they use their own types like cmsUInt16Number to ensure they're wide enough.

Fixes: https://github.com/hughsie/colord/issues/157

hughsie commented 12 months ago

Thanks!

thesamesam commented 12 months ago

No worries, thanks for the quick review/merge!