long is only 32-bits on x64 Win32, but time_t is 64-bits. This was warning:
POSIX.xs(1777) : warning C4244: 'initializing' : conversion from 'time_t' to 'const long', possible loss of data
The check against (time_t)-1 is the approved check from ANSI C 89 and
99.
mytm.tm_yday = yday;
mytm.tm_isdst = isdst;
if (ix) {
- const long result = mktime(&mytm);
- if (result == -1)
+ const time_t result = mktime(&mytm);
+ if (result == (time_t)-1)
SvOK_off(TARG);
else if (result == 0)
sv_setpvn(TARG, "0 but true", 10);