unix/modtime: Add type casting for mktime return value.

This adds type casting to avoid build errors on certain systems.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This commit is contained in:
Yanfeng Liu
2025-10-18 14:44:25 +08:00
committed by Damien George
parent 2b5669d193
commit 4f2f520dc2

View File

@@ -189,7 +189,7 @@ static mp_obj_t mod_time_mktime(mp_obj_t tuple) {
time.tm_isdst = -1; // auto-detect
}
time_t ret = mktime(&time);
if (ret == -1) {
if (ret == (time_t)-1) {
mp_raise_msg(&mp_type_OverflowError, MP_ERROR_TEXT("invalid mktime usage"));
}
return timeutils_obj_from_timestamp(ret);