diff options
| author | Eli Zaretskii | 2018-10-07 20:51:11 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2018-10-07 20:51:11 +0300 |
| commit | a0605d96187bc4103a982cededcd12e2628aba66 (patch) | |
| tree | 83c30f28f794399384246f0bc0b082382ebdef29 /src | |
| parent | 1baf191a484f9942352e37183c66e2471a8cb577 (diff) | |
| download | emacs-a0605d96187bc4103a982cededcd12e2628aba66.tar.gz emacs-a0605d96187bc4103a982cededcd12e2628aba66.zip | |
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.
Diffstat (limited to 'src')
| -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) | |||
| 896 | ns = mpz_fdiv_q_ui (*q, *q, TIMESPEC_HZ); | 896 | ns = mpz_fdiv_q_ui (*q, *q, TIMESPEC_HZ); |
| 897 | } | 897 | } |
| 898 | 898 | ||
| 899 | if (mpz_time (*q, &result.tv_sec)) | 899 | /* With some versions of MinGW, tv_sec is a 64-bit type, whereas |
| 900 | result.tv_nsec = ns; | 900 | time_t is a 32-bit type. */ |
| 901 | time_t sec; | ||
| 902 | if (mpz_time (*q, &sec)) | ||
| 903 | { | ||
| 904 | result.tv_sec = sec; | ||
| 905 | result.tv_nsec = ns; | ||
| 906 | } | ||
| 901 | return result; | 907 | return result; |
| 902 | } | 908 | } |
| 903 | 909 | ||