Branch: refs/heads/smoke-me/fix-bsd-build-tm_zone
Home: https://github.com/Perl/perl5
Commit: 764fd079054bf7e7b1ceadf7db750bc8b34a7b79
https://github.com/Perl/perl5/commit/764fd079054bf7e7b1ceadf7db750bc8b34a7b79
Author: Lukas Mai <[email protected]>
Date: 2024-02-08 (Thu, 08 Feb 2024)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: use type-agnostic code for storing tm_zone
On some platforms, struct tm has a tm_zone member, but its type is not
consistent:
- Linux: const char *tm_zone;
- FreeBSD (& probably other BSDs): char *tm_zone;
In order to save/restore tm_zone, we can't just use a "const char *" or
"char *" variable because different parts of this code would always be a
const violation on one platform or the other.
Workaround: Use the tm_zone member of a full struct tm, which has the
right type no matter the platform.
Fixes #21948.