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.
This commit is contained in:
parent
1baf191a48
commit
a0605d9618
1 changed files with 8 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue