Changeset 12644 in project for chicken/trunk/posixwin.scm


Ignore:
Timestamp:
11/29/08 04:41:31 (13 years ago)
Author:
Kon Lovett
Message:

Make sure tzname, etc. variables are set before use. Doubtful if tzname will be used before a time.h proc is used but to be safe.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/posixwin.scm

    r12342 r12644  
    7070  (usual-integrations)
    7171  (hide ##sys#stat posix-error
    72         $quote-args-list $exec-setup $exec-teardown)
     72        $quote-args-list $exec-setup $exec-teardown
     73        check-time-vector)
    7374  (foreign-declare #<<EOF
    7475#ifndef WIN32_LEAN_AND_MEAN
     
    16841685;;; Time related things:
    16851686
     1687(define (check-time-vector loc tm)
     1688  (##sys#check-vector tm loc)
     1689  (when (fx< (##sys#size tm) 10)
     1690    (##sys#error loc "time vector too short" tm) ) )
     1691
    16861692(define (seconds->local-time secs)
    16871693  (##sys#check-number secs 'seconds->local-time)
     
    17041710        [strftime (foreign-lambda c-string "C_strftime" scheme-object scheme-object)])
    17051711    (lambda (tm #!optional fmt)
    1706       (##sys#check-vector tm 'time->string)
    1707       (when (fx< (##sys#size tm) 10) (##sys#error 'time->string "time vector too short" tm))
     1712      (check-time-vector 'time->string tm)
    17081713      (if fmt
    17091714          (begin
     
    17171722
    17181723(define (local-time->seconds tm)
    1719   (##sys#check-vector tm 'local-time->seconds)
    1720   (when (fx< (##sys#size tm) 10) (##sys#error 'local-time->seconds "time vector too short" tm))
     1724  (check-time-vector 'local-time->seconds tm)
    17211725  (if (##core#inline "C_mktime" tm)
    17221726      (##sys#cons-flonum)
     
    17251729(define local-timezone-abbreviation
    17261730  (foreign-lambda* c-string ()
    1727    "char *z = (daylight ? _tzname[1] : _tzname[0]);"
     1731   "char *z = (_daylight ? _tzname[1] : _tzname[0]);\n"
    17281732   "return(z);") )
    17291733
Note: See TracChangeset for help on using the changeset viewer.