sigaltstck: add missing include
[libc-test.git] / src / api / time.c
blobc87fee4029e67a08a3c18f2cdac2dadb94f1a66c
1 #include <time.h>
2 #define T(t) (t*)0;
3 #define F(t,n) {t *y = &x.n;}
4 #define C(n) switch(n){case n:;}
5 static void f()
7 T(clock_t)
8 T(size_t)
9 T(time_t)
10 #ifdef _POSIX_C_SOURCE
11 T(clockid_t)
12 T(timer_t)
13 T(locale_t)
14 T(pid_t)
15 T(struct sigevent)
17 struct timespec x;
18 F(time_t,tv_sec)
19 F(long,tv_nsec)
22 struct itimerspec x;
23 F(struct timespec,it_interval)
24 F(struct timespec,it_value)
26 C(CLOCK_MONOTONIC)
27 C(CLOCK_PROCESS_CPUTIME_ID)
28 C(CLOCK_REALTIME)
29 C(CLOCK_THREAD_CPUTIME_ID)
30 #endif
32 struct tm x;
33 F(int,tm_sec)
34 F(int,tm_min)
35 F(int,tm_hour)
36 F(int,tm_mday)
37 F(int,tm_mon)
38 F(int,tm_year)
39 F(int,tm_wday)
40 F(int,tm_yday)
41 F(int,tm_isdst)
43 {void *x = NULL;}
44 {int x = CLOCKS_PER_SEC;}
45 C(TIMER_ABSTIME)
46 {char*(*p)(const struct tm*) = asctime;}
47 {clock_t(*p)(void) = clock;}
48 {char*(*p)(const time_t*) = ctime;}
49 {double(*p)(time_t,time_t) = difftime;}
50 {struct tm*(*p)(const time_t*) = gmtime;}
51 {struct tm*(*p)(const time_t*) = localtime;}
52 {time_t(*p)(struct tm*) = mktime;}
53 {size_t(*p)(char*restrict,size_t,const char*restrict,const struct tm*restrict) = strftime;}
54 {time_t(*p)(time_t*) = time;}
55 #ifdef _POSIX_C_SOURCE
56 {char*(*p)(const struct tm*restrict,char*restrict) = asctime_r;}
57 {int(*p)(pid_t,clockid_t*) = clock_getcpuclockid;}
58 {int(*p)(clockid_t,struct timespec*) = clock_getres;}
59 {int(*p)(clockid_t,struct timespec*) = clock_gettime;}
60 {int(*p)(clockid_t,int,const struct timespec*,struct timespec*) = clock_nanosleep;}
61 {int(*p)(clockid_t,const struct timespec*) = clock_settime;}
62 {char*(*p)(const time_t*,char*) = ctime_r;}
63 {struct tm*(*p)(const time_t*restrict,struct tm*restrict) = gmtime_r;}
64 {struct tm*(*p)(const time_t*restrict,struct tm*restrict) = localtime_r;}
65 {int(*p)(const struct timespec*,struct timespec*) = nanosleep;}
66 {size_t(*p)(char*restrict,size_t,const char*restrict,const struct tm*restrict,locale_t) = strftime_l;}
67 {int(*p)(clockid_t,struct sigevent*restrict,timer_t*restrict) = timer_create;}
68 {int(*p)(timer_t) = timer_delete;}
69 {int(*p)(timer_t) = timer_getoverrun;}
70 {int(*p)(timer_t,struct itimerspec*) = timer_gettime;}
71 {int(*p)(timer_t,int,const struct itimerspec*restrict,struct itimerspec*restrict) = timer_settime;}
72 {char **x = tzname;}
73 {void(*p)(void) = tzset;}
74 #endif
75 #ifdef _XOPEN_SOURCE
76 {struct tm*(*p)(const char*) = getdate;}
77 {int i = getdate_err;}
78 {char*(*p)(const char*restrict,const char*restrict,struct tm*restrict) = strptime;}
79 {long i = timezone;}
80 {int i = daylight;}
81 #endif