File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -321,7 +321,12 @@ time_strftime(self, args)
321321 buf .tm_mon -- ;
322322 buf .tm_wday = (buf .tm_wday + 1 ) % 7 ;
323323 buf .tm_yday -- ;
324+ #ifdef HAVE_MKTIME
325+ /* This call is only there to adjust the numbers to be within
326+ bounds. When we don't have mktime(), we say the caller is
327+ responsible for that... */
324328 (void ) mktime (& buf );
329+ #endif
325330 /* I hate these functions that presume you know how big the output
326331 * will be ahead of time...
327332 */
@@ -380,6 +385,7 @@ time_ctime(self, args)
380385 return PyString_FromString (p );
381386}
382387
388+ #ifdef HAVE_MKTIME
383389static PyObject *
384390time_mktime (self , args )
385391 PyObject * self ;
@@ -399,6 +405,7 @@ time_mktime(self, args)
399405 }
400406 return PyFloat_FromDouble ((double )tt );
401407}
408+ #endif /* HAVE_MKTIME */
402409
403410static PyMethodDef time_methods [] = {
404411 {"time" , time_time },
@@ -410,7 +417,9 @@ static PyMethodDef time_methods[] = {
410417 {"localtime" , time_localtime },
411418 {"asctime" , time_asctime },
412419 {"ctime" , time_ctime },
420+ #ifdef HAVE_MKTIME
413421 {"mktime" , time_mktime },
422+ #endif
414423#ifdef HAVE_STRFTIME
415424 {"strftime" , time_strftime , 1 },
416425#endif
You can’t perform that action at this time.
0 commit comments