compiler/clc: fix compiler issue on MacOS with st_mtim[e] in stat.

MacOSs 'sys/stat.h' version of 'stat' doe snot have the 'st_mtim' that is used on other systems.
The change allows MacOS to use 'st_mtime' without affecting the behaviour on any other platform.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28130>
This commit is contained in:
duncan.hopkins 2023-11-16 15:22:13 +00:00 committed by Marge Bot
parent 6146a1651a
commit 8387deff87

View file

@ -124,7 +124,11 @@ open_clc_data(struct clc_data *clc, unsigned ptr_bit_size)
struct mesa_sha1 ctx;
_mesa_sha1_init(&ctx);
_mesa_sha1_update(&ctx, clc->file->sys_path, strlen(clc->file->sys_path));
#if defined(__APPLE__) || defined(__MACOSX)
_mesa_sha1_update(&ctx, &stat.st_mtime, sizeof(stat.st_mtime));
#else
_mesa_sha1_update(&ctx, &stat.st_mtim, sizeof(stat.st_mtim));
#endif
_mesa_sha1_final(&ctx, clc->cache_key);
clc->fd = fd;