| OLD | NEW |
| 1 /* Portions are Copyright (C) 2007 Google Inc */ | 1 /* Portions are Copyright (C) 2007 Google Inc */ |
| 2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
| 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 4 * | 4 * |
| 5 * The contents of this file are subject to the Mozilla Public License Version | 5 * The contents of this file are subject to the Mozilla Public License Version |
| 6 * 1.1 (the "License"); you may not use this file except in compliance with | 6 * 1.1 (the "License"); you may not use this file except in compliance with |
| 7 * the License. You may obtain a copy of the License at | 7 * the License. You may obtain a copy of the License at |
| 8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
| 9 * | 9 * |
| 10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 * This was modified to use the Win32 SYSTEMTIME/FILETIME structures | 56 * This was modified to use the Win32 SYSTEMTIME/FILETIME structures |
| 57 * and the timezone offsets are applied to the FILETIME structure. | 57 * and the timezone offsets are applied to the FILETIME structure. |
| 58 * All types and macros are defined in the base/third_party/prtime.h file. | 58 * All types and macros are defined in the base/third_party/prtime.h file. |
| 59 * These have been copied from the following nspr files. We have only copied | 59 * These have been copied from the following nspr files. We have only copied |
| 60 * over the types we need. | 60 * over the types we need. |
| 61 * 1. prtime.h | 61 * 1. prtime.h |
| 62 * 2. prtypes.h | 62 * 2. prtypes.h |
| 63 * 3. prlong.h | 63 * 3. prlong.h |
| 64 */ | 64 */ |
| 65 | 65 |
| 66 #include "base/logging.h" |
| 66 #include "base/third_party/nspr/prtime.h" | 67 #include "base/third_party/nspr/prtime.h" |
| 68 #include "base/third_party/nspr/prtypes.h" |
| 67 #include "build/build_config.h" | 69 #include "build/build_config.h" |
| 68 | 70 |
| 69 #if defined(OS_WIN) | 71 #if defined(OS_WIN) |
| 70 #include <windows.h> | 72 #include <windows.h> |
| 71 #elif defined(OS_MACOSX) | 73 #elif defined(OS_MACOSX) |
| 72 #include <CoreFoundation/CoreFoundation.h> | |
| 73 #endif | 74 #endif |
| 74 #include <errno.h> /* for EINVAL */ | 75 #include </Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/CoreFoundatio
n.framework/Headers/CFDate.h> |
| 76 #include <ctype.h> |
| 77 #include <string.h> |
| 75 #include <time.h> | 78 #include <time.h> |
| 76 | 79 |
| 77 /* Implements the Unix localtime_r() function for windows */ | 80 /* Implements the Unix localtime_r() function for windows */ |
| 78 #if defined(OS_WIN) | 81 #if defined(OS_WIN) |
| 79 static void localtime_r(const time_t* secs, struct tm* time) { | 82 static void localtime_r(const time_t* secs, struct tm* time) { |
| 80 (void) localtime_s(time, secs); | 83 (void) localtime_s(time, secs); |
| 81 } | 84 } |
| 82 #endif | 85 #endif |
| 83 | 86 |
| 84 /* | 87 /* |
| (...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1194 + 60 * localTime.tm_hour | 1197 + 60 * localTime.tm_hour |
| 1195 + 1440 * (localTime.tm_mday - 2); | 1198 + 1440 * (localTime.tm_mday - 2); |
| 1196 } | 1199 } |
| 1197 | 1200 |
| 1198 result->tm_params.tp_gmt_offset = zone_offset * 60; | 1201 result->tm_params.tp_gmt_offset = zone_offset * 60; |
| 1199 result->tm_params.tp_dst_offset = dst_offset * 60; | 1202 result->tm_params.tp_dst_offset = dst_offset * 60; |
| 1200 | 1203 |
| 1201 *result_imploded = PR_ImplodeTime(result); | 1204 *result_imploded = PR_ImplodeTime(result); |
| 1202 return PR_SUCCESS; | 1205 return PR_SUCCESS; |
| 1203 } | 1206 } |
| OLD | NEW |