diff options
author | Eli Zaretskii <eliz@gnu.org> | 2018-10-07 20:51:11 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2018-10-07 20:51:11 +0300 |
commit | a0605d96187bc4103a982cededcd12e2628aba66 (patch) | |
tree | 83c30f28f794399384246f0bc0b082382ebdef29 | |
parent | 1baf191a484f9942352e37183c66e2471a8cb577 (diff) | |
download | emacs-a0605d96187bc4103a982cededcd12e2628aba66.tar.gz |
Fix MinGW compilation problem in timefns.c
* src/timefns.c (lisp_to_timespec): Fix a mismatch between
time_t and timespec.tv_sec data types.
-rw-r--r-- | src/timefns.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/timefns.c b/src/timefns.c index 7bce3b1e500..c94d97d9a84 100644 --- a/src/timefns.c +++ b/src/timefns.c @@ -896,8 +896,14 @@ lisp_to_timespec (struct lisp_time t) ns = mpz_fdiv_q_ui (*q, *q, TIMESPEC_HZ); } - if (mpz_time (*q, &result.tv_sec)) - result.tv_nsec = ns; + /* With some versions of MinGW, tv_sec is a 64-bit type, whereas + time_t is a 32-bit type. */ + time_t sec; + if (mpz_time (*q, &sec)) + { + result.tv_sec = sec; + result.tv_nsec = ns; + } return result; } |