diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/mac.c | 13 |
1 files changed, 5 insertions, 8 deletions
| @@ -1127,18 +1127,15 @@ Lisp_Object | |||
| 1127 | cfdate_to_lisp (date) | 1127 | cfdate_to_lisp (date) |
| 1128 | CFDateRef date; | 1128 | CFDateRef date; |
| 1129 | { | 1129 | { |
| 1130 | static const CFGregorianDate epoch_gdate = {1970, 1, 1, 0, 0, 0.0}; | 1130 | CFTimeInterval sec; |
| 1131 | static CFAbsoluteTime epoch = 0.0, sec; | 1131 | int high, low, microsec; |
| 1132 | int high, low; | ||
| 1133 | 1132 | ||
| 1134 | if (epoch == 0.0) | 1133 | sec = CFDateGetAbsoluteTime (date) + kCFAbsoluteTimeIntervalSince1970; |
| 1135 | epoch = CFGregorianDateGetAbsoluteTime (epoch_gdate, NULL); | ||
| 1136 | |||
| 1137 | sec = CFDateGetAbsoluteTime (date) - epoch; | ||
| 1138 | high = sec / 65536.0; | 1134 | high = sec / 65536.0; |
| 1139 | low = sec - high * 65536.0; | 1135 | low = sec - high * 65536.0; |
| 1136 | microsec = (sec - floor (sec)) * 1000000.0; | ||
| 1140 | 1137 | ||
| 1141 | return list3 (make_number (high), make_number (low), make_number (0)); | 1138 | return list3 (make_number (high), make_number (low), make_number (microsec)); |
| 1142 | } | 1139 | } |
| 1143 | 1140 | ||
| 1144 | 1141 | ||