Changeset 8726


Ignore:
Timestamp:
Mar 11, 2008, 6:51:33 PM (12 years ago)
Author:
gb
Message:

This file will need a lot of work, but try to get some support for
Windows universal-time stuff working.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/win64/level-1/linux-files.lisp

    r8587 r8726  
    3131
    3232
     33(defconstant unix-to-universal-time 2208988800)
     34
     35#+windows-target
     36(progn
     37(defconstant univeral-time-start-in-windows-seconds 9435484800)
     38
     39(defun windows-filetime-to-universal-time (filetime)
     40  (let* ((100-ns (dpb (pref ft #>FILETIME.dwHighDateTime) (byte 32 32)
     41                      (pref ft #>FILETIME.dwLowDateTime)))
     42         (seconds-since-windows-epoch (floor 100-ns 10000000)))
     43    (- seconds-since-windows-epoch univeral-time-start-in-windows-seconds)))
     44)
     45
    3346(defun get-foreign-namestring (pointer)
    3447  ;; On Darwin, foreign namestrings are encoded in UTF-8 and
     
    3851  #+darwin-target
    3952  (precompose-simple-string (%get-utf-8-cstring pointer))
     53  #+windows-target (%get-native-utf-16-cstring pointer)
    4054  ;; On some other platforms, the namestring is assumed to
    4155  ;; be encoded according to the current locale's character
    4256  ;; encoding (though FreeBSD seems to be moving towards
    4357  ;; precomposed UTF-8.).
    44   ;; In any case, the use if %GET-CSTRING here is wrong ...
    45   #-darwin-target
     58  ;; In any case, the use of %GET-CSTRING here is wrong ...
     59  #-(or darwin-target windows-taget)
    4660  (%get-cstring pointer))
    4761
     
    497511
    498512
    499 (defconstant unix-to-universal-time 2208988800)
    500513
    501514(defun %file-write-date (namestring)
Note: See TracChangeset for help on using the changeset viewer.