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