Changeset 13973 in project


Ignore:
Timestamp:
03/27/09 19:05:24 (11 years ago)
Author:
Kon Lovett
Message:

Save.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/locale/trunk/locale-timezone.scm

    r13955 r13973  
    77  (fixnum)
    88  (no-procedure-checks)
     9  (run-time-macros)
    910  (export
    1011    local-timezone
     
    9192                  (* (string->number (substring tzo end (+ end 2))) 60))) )
    9293    (if neg? (- secs) secs) ) )
     94
     95;;
     96
     97(define-macro (with-tzset ?tz . ?body)
     98  (let ((tzvar (gensym)))
     99    `(let ((,tzvar (getenv "TZ")))
     100       (dynamic-wind
     101         (lambda () (setenv "TZ" ,?tz) ((foreign-lambda void "tzset")))
     102         (lambda () ,@?body)
     103         (lambda () (setenv "TZ" ,tzvar) ((foreign-lambda void "tzset"))) ) ) ) )
Note: See TracChangeset for help on using the changeset viewer.