compat_localtime.c revision 1.4 1 1.4 christos /* $NetBSD: compat_localtime.c,v 1.4 2024/09/11 13:50:35 christos Exp $ */
2 1.2 christos
3 1.2 christos /*
4 1.2 christos * Written by Jason R. Thorpe <thorpej (at) NetBSD.org>, October 21, 1997.
5 1.2 christos * Public domain.
6 1.2 christos */
7 1.2 christos
8 1.2 christos #include "namespace.h"
9 1.2 christos #include <sys/cdefs.h>
10 1.2 christos
11 1.2 christos #define __LIBC12_SOURCE__
12 1.2 christos #include <time.h>
13 1.2 christos #include <sys/time.h>
14 1.2 christos #include <compat/include/time.h>
15 1.2 christos #include <compat/sys/time.h>
16 1.2 christos
17 1.2 christos #ifdef __weak_alias
18 1.2 christos __weak_alias(gmtime_r,_gmtime_r)
19 1.2 christos __weak_alias(localtime_r,_localtime_r)
20 1.3 christos __weak_alias(localtime_rz,_localtime_rz)
21 1.3 christos __weak_alias(mktime_z,_mktime_z)
22 1.2 christos __weak_alias(offtime,_offtime)
23 1.2 christos __weak_alias(posix2time,_posix2time)
24 1.3 christos __weak_alias(posix2time_z,_posix2time_z)
25 1.2 christos __weak_alias(time2posix,_time2posix)
26 1.2 christos __weak_alias(timegm,_timegm)
27 1.2 christos __weak_alias(timelocal,_timelocal)
28 1.2 christos __weak_alias(timeoff,_timeoff)
29 1.2 christos __weak_alias(tzset,_tzset)
30 1.2 christos __weak_alias(tzsetwall,_tzsetwall)
31 1.2 christos #endif
32 1.2 christos
33 1.2 christos __warn_references(gmtime_r,
34 1.2 christos "warning: reference to compatibility gmtime_r();"
35 1.2 christos " include <time.h> for correct reference")
36 1.2 christos __warn_references(localtime_r,
37 1.2 christos "warning: reference to compatibility localtime_r();"
38 1.2 christos " include <time.h> for correct reference")
39 1.3 christos __warn_references(localtime_rz,
40 1.3 christos "warning: reference to compatibility localtime_rz();"
41 1.3 christos " include <time.h> for correct reference")
42 1.3 christos __warn_references(mktime_z,
43 1.3 christos "warning: reference to compatibility mktime_z();"
44 1.3 christos " include <time.h> for correct reference")
45 1.2 christos __warn_references(offtime,
46 1.2 christos "warning: reference to compatibility offtime();"
47 1.2 christos " include <time.h> for correct reference")
48 1.2 christos __warn_references(posix2time,
49 1.2 christos "warning: reference to compatibility posix2time();"
50 1.2 christos " include <time.h> for correct reference")
51 1.3 christos __warn_references(posix2time_z,
52 1.3 christos "warning: reference to compatibility posix2time_z();"
53 1.3 christos " include <time.h> for correct reference")
54 1.2 christos __warn_references(time2posix,
55 1.2 christos "warning: reference to compatibility time2posix();"
56 1.2 christos " include <time.h> for correct reference")
57 1.2 christos __warn_references(timegm,
58 1.2 christos "warning: reference to compatibility timegm();"
59 1.2 christos " include <time.h> for correct reference")
60 1.2 christos __warn_references(timelocal,
61 1.2 christos "warning: reference to compatibility timelocal();"
62 1.2 christos " include <time.h> for correct reference")
63 1.2 christos __warn_references(timeoff,
64 1.2 christos "warning: reference to compatibility timeoff();"
65 1.2 christos " include <time.h> for correct reference")
66 1.2 christos __warn_references(tzset,
67 1.2 christos "warning: reference to compatibility tzset();"
68 1.2 christos " include <time.h> for correct reference")
69 1.2 christos __warn_references(tzsetwall,
70 1.2 christos "warning: reference to compatibility tzsetwall();"
71 1.2 christos " include <time.h> for correct reference")
72 1.2 christos
73 1.2 christos #define timeval timeval50
74 1.2 christos #define timespec timespec50
75 1.2 christos #define time_t int32_t
76 1.2 christos
77 1.2 christos #include "time/localtime.c"
78