The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /* |
| 2 | |
| 3 | Copyright (c) 2007-2008 Michael G Schwern |
| 4 | |
| 5 | This software originally derived from Paul Sheer's pivotal_gmtime_r.c. |
| 6 | |
| 7 | The MIT License: |
| 8 | |
| 9 | Permission is hereby granted, free of charge, to any person obtaining a copy |
| 10 | of this software and associated documentation files (the "Software"), to deal |
| 11 | in the Software without restriction, including without limitation the rights |
| 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 13 | copies of the Software, and to permit persons to whom the Software is |
| 14 | furnished to do so, subject to the following conditions: |
| 15 | |
| 16 | The above copyright notice and this permission notice shall be included in |
| 17 | all copies or substantial portions of the Software. |
| 18 | |
| 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 25 | THE SOFTWARE. |
| 26 | |
| 27 | Origin: http://code.google.com/p/y2038 |
| 28 | Modified for Bionic by the Android Open Source Project |
| 29 | |
| 30 | */ |
| 31 | #ifndef TIME64_H |
| 32 | #define TIME64_H |
| 33 | |
Elliott Hughes | 8d77bce | 2014-04-22 13:55:58 -0700 | [diff] [blame^] | 34 | #if defined(__LP64__) |
| 35 | |
| 36 | /* TODO: remove this when external/chromium_org is fixed. */ |
| 37 | #define time64_t time_t |
| 38 | #define gmtime64_r gmtime_r |
| 39 | #define localtime64_r localtime_r |
| 40 | #define mktime64 mktime |
| 41 | #define timegm64 timegm |
| 42 | |
| 43 | #else |
| 44 | |
| 45 | /* Legacy cruft for LP32 where time_t was 32-bit. */ |
| 46 | |
Fred Fettinger | b5239ed | 2009-11-20 16:57:14 -0600 | [diff] [blame] | 47 | #include <sys/cdefs.h> |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 48 | #include <time.h> |
| 49 | #include <stdint.h> |
| 50 | |
Fred Fettinger | b5239ed | 2009-11-20 16:57:14 -0600 | [diff] [blame] | 51 | __BEGIN_DECLS |
| 52 | |
Elliott Hughes | 8d77bce | 2014-04-22 13:55:58 -0700 | [diff] [blame^] | 53 | typedef int64_t time64_t; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 54 | |
Elliott Hughes | 8d77bce | 2014-04-22 13:55:58 -0700 | [diff] [blame^] | 55 | char* asctime64(const struct tm*); |
| 56 | char* asctime64_r(const struct tm*, char*); |
| 57 | char* ctime64(const time64_t*); |
| 58 | char* ctime64_r(const time64_t*, char*); |
| 59 | struct tm* gmtime64(const time64_t*); |
| 60 | struct tm* gmtime64_r(const time64_t*, struct tm*); |
| 61 | struct tm* localtime64(const time64_t*); |
| 62 | struct tm* localtime64_r(const time64_t*, struct tm*); |
| 63 | time64_t mktime64(const struct tm*); |
| 64 | time64_t timegm64(const struct tm*); |
| 65 | time64_t timelocal64(const struct tm*); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 66 | |
Fred Fettinger | b5239ed | 2009-11-20 16:57:14 -0600 | [diff] [blame] | 67 | __END_DECLS |
| 68 | |
Elliott Hughes | 8d77bce | 2014-04-22 13:55:58 -0700 | [diff] [blame^] | 69 | #endif |
| 70 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 71 | #endif /* TIME64_H */ |