diff options
Diffstat (limited to 'src/timefns.c')
-rw-r--r-- | src/timefns.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/timefns.c b/src/timefns.c index 4c99fe58061..ce1f4d3f5a9 100644 --- a/src/timefns.c +++ b/src/timefns.c @@ -25,6 +25,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ #include "bignum.h" #include "coding.h" #include "lisp.h" +#include "pdumper.h" #include <strftime.h> @@ -291,7 +292,7 @@ tzlookup (Lisp_Object zone, bool settz) } void -init_timefns (bool dumping) +init_timefns (void) { #ifndef CANNOT_DUMP /* A valid but unlikely setting for the TZ environment variable. @@ -300,7 +301,7 @@ init_timefns (bool dumping) /* When just dumping out, set the time zone to a known unlikely value and skip the rest of this function. */ - if (dumping) + if (will_dump_with_unexec_p ()) { xputenv (dump_tz_string); tzset (); @@ -1729,6 +1730,19 @@ emacs_setenv_TZ (const char *tzstring) return 0; } +#if (ULONG_MAX < TRILLION || !FASTER_TIMEFNS) && !defined ztrillion +# define NEED_ZTRILLION_INIT 1 +#endif + +#ifdef NEED_ZTRILLION_INIT +static void +syms_of_timefns_for_pdumper (void) +{ + mpz_init_set_ui (ztrillion, 1000000); + mpz_mul_ui (ztrillion, ztrillion, 1000000); +} +#endif + void syms_of_timefns (void) { @@ -1740,10 +1754,6 @@ syms_of_timefns (void) trillion = make_int (1000000000000); staticpro (&trillion); #endif -#if (ULONG_MAX < TRILLION || !FASTER_TIMEFNS) && !defined ztrillion - mpz_init_set_ui (ztrillion, 1000000); - mpz_mul_ui (ztrillion, ztrillion, 1000000); -#endif DEFSYM (Qencode_time, "encode-time"); @@ -1759,4 +1769,7 @@ syms_of_timefns (void) defsubr (&Scurrent_time_string); defsubr (&Scurrent_time_zone); defsubr (&Sset_time_zone_rule); +#ifdef NEED_ZTRILLION_INIT + pdumper_do_now_and_after_load (syms_of_timefns_for_pdumper); +#endif } |