(_hurd_intr_rpc_mach_msg): New declaration.
[glibc.git] / time / private.h
blob69fcca3822b17a25addfd4109a2e5f57ac99c3d4
1 #ifndef PRIVATE_H
3 #define PRIVATE_H
5 /*
6 ** This header is for use ONLY with the time conversion code.
7 ** There is no guarantee that it will remain unchanged,
8 ** or that it will remain at all.
9 ** Do NOT copy it to any system include directory.
10 ** Thank you!
14 ** ID
17 #ifndef lint
18 #ifndef NOID
19 static char privatehid[] = "@(#)private.h 7.42";
20 #endif /* !defined NOID */
21 #endif /* !defined lint */
24 ** Defaults for preprocessor symbols.
25 ** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'.
28 #ifndef HAVE_ADJTIME
29 #define HAVE_ADJTIME 1
30 #endif /* !defined HAVE_ADJTIME */
32 #ifndef HAVE_GETTEXT
33 #define HAVE_GETTEXT 0
34 #endif /* !defined HAVE_GETTEXT */
36 #ifndef HAVE_SETTIMEOFDAY
37 #define HAVE_SETTIMEOFDAY 3
38 #endif /* !defined HAVE_SETTIMEOFDAY */
40 #ifndef HAVE_STRERROR
41 #define HAVE_STRERROR 0
42 #endif /* !defined HAVE_STRERROR */
44 #ifndef HAVE_UNISTD_H
45 #define HAVE_UNISTD_H 1
46 #endif /* !defined HAVE_UNISTD_H */
48 #ifndef HAVE_UTMPX_H
49 #define HAVE_UTMPX_H 0
50 #endif /* !defined HAVE_UTMPX_H */
52 #ifndef LOCALE_HOME
53 #define LOCALE_HOME "/usr/lib/locale"
54 #endif /* !defined LOCALE_HOME */
57 ** Nested includes
60 #include "sys/types.h" /* for time_t */
61 #include "stdio.h"
62 #include "errno.h"
63 #include "string.h"
64 #include "limits.h" /* for CHAR_BIT */
65 #include "time.h"
66 #include "stdlib.h"
68 #if HAVE_GETTEXT - 0
69 #include "libintl.h"
70 #endif /* HAVE_GETTEXT - 0 */
72 #if HAVE_UNISTD_H - 0
73 #include "unistd.h" /* for F_OK and R_OK */
74 #endif /* HAVE_UNISTD_H - 0 */
76 #if !(HAVE_UNISTD_H - 0)
77 #ifndef F_OK
78 #define F_OK 0
79 #endif /* !defined F_OK */
80 #ifndef R_OK
81 #define R_OK 4
82 #endif /* !defined R_OK */
83 #endif /* !(HAVE_UNISTD_H - 0) */
85 /* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
86 #define is_digit(c) ((unsigned)(c) - '0' <= 9)
89 ** Workarounds for compilers/systems.
93 ** SunOS 4.1.1 cc lacks const.
96 #ifndef const
97 #ifndef __STDC__
98 #define const
99 #endif /* !defined __STDC__ */
100 #endif /* !defined const */
103 ** SunOS 4.1.1 cc lacks prototypes.
106 #ifndef P
107 #ifdef __STDC__
108 #define P(x) x
109 #endif /* defined __STDC__ */
110 #ifndef __STDC__
111 #define P(x) ()
112 #endif /* !defined __STDC__ */
113 #endif /* !defined P */
116 ** SunOS 4.1.1 headers lack EXIT_SUCCESS.
119 #ifndef EXIT_SUCCESS
120 #define EXIT_SUCCESS 0
121 #endif /* !defined EXIT_SUCCESS */
124 ** SunOS 4.1.1 headers lack EXIT_FAILURE.
127 #ifndef EXIT_FAILURE
128 #define EXIT_FAILURE 1
129 #endif /* !defined EXIT_FAILURE */
132 ** SunOS 4.1.1 headers lack FILENAME_MAX.
135 #ifndef FILENAME_MAX
137 #ifndef MAXPATHLEN
138 #ifdef unix
139 #include "sys/param.h"
140 #endif /* defined unix */
141 #endif /* !defined MAXPATHLEN */
143 #ifdef MAXPATHLEN
144 #define FILENAME_MAX MAXPATHLEN
145 #endif /* defined MAXPATHLEN */
146 #ifndef MAXPATHLEN
147 #define FILENAME_MAX 1024 /* Pure guesswork */
148 #endif /* !defined MAXPATHLEN */
150 #endif /* !defined FILENAME_MAX */
153 ** SunOS 4.1.1 libraries lack remove.
156 #ifndef remove
157 extern int unlink P((const char * filename));
158 #define remove unlink
159 #endif /* !defined remove */
162 ** Some ancient errno.h implementations don't declare errno.
163 ** But some newer errno.h implementations define it as a macro.
164 ** Fix the former without affecting the latter.
166 #ifndef errno
167 extern int errno;
168 #endif /* !defined errno */
171 ** Finally, some convenience items.
174 #ifndef TRUE
175 #define TRUE 1
176 #endif /* !defined TRUE */
178 #ifndef FALSE
179 #define FALSE 0
180 #endif /* !defined FALSE */
182 #ifndef TYPE_BIT
183 #define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
184 #endif /* !defined TYPE_BIT */
186 #ifndef TYPE_SIGNED
187 #define TYPE_SIGNED(type) (((type) -1) < 0)
188 #endif /* !defined TYPE_SIGNED */
190 #ifndef INT_STRLEN_MAXIMUM
192 ** 302 / 1000 is log10(2.0) rounded up.
193 ** Subtract one for the sign bit if the type is signed;
194 ** add one for integer division truncation;
195 ** add one more for a minus sign if the type is signed.
197 #define INT_STRLEN_MAXIMUM(type) \
198 ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 100 + 1 + TYPE_SIGNED(type))
199 #endif /* !defined INT_STRLEN_MAXIMUM */
202 ** INITIALIZE(x)
205 #ifndef GNUC_or_lint
206 #ifdef lint
207 #define GNUC_or_lint
208 #endif /* defined lint */
209 #ifndef lint
210 #ifdef __GNUC__
211 #define GNUC_or_lint
212 #endif /* defined __GNUC__ */
213 #endif /* !defined lint */
214 #endif /* !defined GNUC_or_lint */
216 #ifndef INITIALIZE
217 #ifdef GNUC_or_lint
218 #define INITIALIZE(x) ((x) = 0)
219 #endif /* defined GNUC_or_lint */
220 #ifndef GNUC_or_lint
221 #define INITIALIZE(x)
222 #endif /* !defined GNUC_or_lint */
223 #endif /* !defined INITIALIZE */
226 ** For the benefit of GNU folk...
227 ** `_(MSGID)' uses the current locale's message library string for MSGID.
228 ** The default is to use gettext if available, and use MSGID otherwise.
231 #ifndef _
232 #if HAVE_GETTEXT - 0
233 #define _(msgid) gettext(msgid)
234 #else /* !(HAVE_GETTEXT - 0) */
235 #define _(msgid) msgid
236 #endif /* !(HAVE_GETTEXT - 0) */
237 #endif /* !defined _ */
239 #ifndef TZ_DOMAIN
240 #define TZ_DOMAIN "tz"
241 #endif /* !defined TZ_DOMAIN */
244 ** UNIX was a registered trademark of UNIX System Laboratories in 1993.
247 #endif /* !defined PRIVATE_H */