OLD | NEW |
1 /* Portions are Copyright (C) 2011 Google Inc */ | 1 /* Portions are Copyright (C) 2011 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 #include "base/third_party/nspr/prtime.h" | 67 #include "base/third_party/nspr/prtime.h" |
68 #include "build/build_config.h" | 68 #include "build/build_config.h" |
69 | 69 |
70 #if defined(OS_WIN) | 70 #if defined(OS_WIN) |
71 #include <windows.h> | 71 #include <windows.h> |
72 #elif defined(OS_MACOSX) | 72 #elif defined(OS_MACOSX) |
73 #include <CoreFoundation/CoreFoundation.h> | 73 #include <CoreFoundation/CoreFoundation.h> |
74 #elif defined(OS_ANDROID) | 74 #elif defined(OS_ANDROID) |
75 #include <ctype.h> | 75 #include <ctype.h> |
76 #include "base/os_compat_android.h" // For timegm() | 76 #include "base/os_compat_android.h" // For timegm() |
| 77 #elif defined(OS_NACL) |
| 78 #include "base/os_compat_nacl.h" // For timegm() |
77 #endif | 79 #endif |
78 #include <errno.h> /* for EINVAL */ | 80 #include <errno.h> /* for EINVAL */ |
79 #include <time.h> | 81 #include <time.h> |
80 | 82 |
81 /* Implements the Unix localtime_r() function for windows */ | 83 /* Implements the Unix localtime_r() function for windows */ |
82 #if defined(OS_WIN) | 84 #if defined(OS_WIN) |
83 static void localtime_r(const time_t* secs, struct tm* time) { | 85 static void localtime_r(const time_t* secs, struct tm* time) { |
84 (void) localtime_s(time, secs); | 86 (void) localtime_s(time, secs); |
85 } | 87 } |
86 #endif | 88 #endif |
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 + 60 * localTime.tm_hour | 1200 + 60 * localTime.tm_hour |
1199 + 1440 * (localTime.tm_mday - 2); | 1201 + 1440 * (localTime.tm_mday - 2); |
1200 } | 1202 } |
1201 | 1203 |
1202 result->tm_params.tp_gmt_offset = zone_offset * 60; | 1204 result->tm_params.tp_gmt_offset = zone_offset * 60; |
1203 result->tm_params.tp_dst_offset = dst_offset * 60; | 1205 result->tm_params.tp_dst_offset = dst_offset * 60; |
1204 | 1206 |
1205 *result_imploded = PR_ImplodeTime(result); | 1207 *result_imploded = PR_ImplodeTime(result); |
1206 return PR_SUCCESS; | 1208 return PR_SUCCESS; |
1207 } | 1209 } |
OLD | NEW |