root/src/noit_config.h.in

Revision dfec9683c6674557f3639bb6485d369ebd6a347b, 6.6 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 2 years ago)

Make sure we compile with clang (trunk) on Ubuntu 11.10

This is a good milestone, so let's do an intermediate commit:
At this point we are able to compile with Clang (trunk, no less;)
on Ubuntu 11.10. I was careful with the introduced changes not to
introduce any regressions:

* bsd/libutil.h is prefered, otherwise we fallback to libutil.h
* replaced isinteger()'s guts with a call to strtod()

  • Property mode set to 100644
Line 
1 /*
2  * Copyright (c) 2005-2009, OmniTI Computer Consulting, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met:
8  *
9  *    * Redistributions of source code must retain the above copyright
10  *      notice, this list of conditions and the following disclaimer.
11  *    * Redistributions in binary form must reproduce the above
12  *      copyright notice, this list of conditions and the following
13  *      disclaimer in the documentation and/or other materials provided
14  *      with the distribution.
15  *    * Neither the name OmniTI Computer Consulting, Inc. nor the names
16  *      of its contributors may be used to endorse or promote products
17  *      derived from this software without specific prior written
18  *      permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32
33 #ifndef __NOIT_CONFIG_H
34 #define __NOIT_CONFIG_H
35
36 /* define inline unless that is what the compiler already calls it. */
37 #undef inline
38
39 #undef DTRACE_ENABLED
40 #ifndef DTRACE_ENABLED
41 #define DTRACE_PROBES_DISABLED 1
42 #endif
43 #undef MODULEEXT
44 #undef MODULES_DIR
45 #undef DEFAULT_EVENTER
46 #undef ETC_DIR
47
48 #undef HAVE_FCNTL_H
49 #undef HAVE_UNISTD_H
50 #undef HAVE_SYS_TYPES_H
51 #undef HAVE_SYS_WAIT_H
52 #undef HAVE_TERM_H
53 #undef HAVE_TERMIO_H
54 #undef HAVE_TERMIOS_H
55 #undef TPUTS_TAKES_CHAR
56 #undef HAVE_SYS_IOCTL_COMPAT_H
57 #undef HAVE_SYS_IOCTL_H
58 #undef HAVE_SYS_FILIO_H
59 #undef HAVE_STROPTS_H
60 #undef HAVE_SYS_STREAM_H
61 #undef HAVE_UTIL_H
62 #undef HAVE_BSD_LIBUTIL_H
63 #undef HAVE_LIBUTIL_H
64 #undef HAVE_CURSES_H
65 #undef HAVE_DIRENT_H
66 #undef HAVE_PWD_H
67 #undef HAVE_PTY_H
68 #undef HAVE_ERRNO_H
69 #undef HAVE_STRING_H
70 #undef HAVE_STDLIB_H
71 #undef HAVE_SYS_PARAM_H
72 #undef HAVE_SEMAPHORE_H
73 #undef HAVE_ALLOCA_H
74 #undef HAVE_TIME_H
75 #undef HAVE_SYS_STAT_H
76 #undef HAVE_SYS_RESOURCE_H
77 #undef HAVE_SYS_CDEFS_H
78 #undef HAVE_LIBKERN_OSATOMIC_H
79 #undef HAVE_NETINET_IN_SYSTM_H
80 #undef HAVE_POSIX_READDIR_R
81 #undef HAVE_MYSQL_H
82 #undef HAVE_MYSQL_MYSQL_H
83 #undef HAVE_INT64_T
84 #undef HAVE_INTXX_T
85 #undef HAVE_LONG_LONG_INT
86 #undef HAVE_UINTXX_T
87 #undef HAVE_U_INT
88 #undef HAVE_U_INT64_T
89 #undef HAVE_U_INTXX_T
90 #undef HAVE_UUID_UNPARSE_LOWER
91 #define IFS_CH '/'
92 #undef WORKING_SEM_INIT
93
94 #undef HAVE_GETPWNAM_R
95 #undef HAVE_GETPWNAM_R_POSIX
96 #undef HAVE_GETGRNAM_R
97 #undef HAVE_GETGRNAM_R_POSIX
98
99 #ifdef HAVE_STRING_H
100 #include <string.h>
101 #endif
102 #ifdef HAVE_STDLIB_H
103 #include <stdlib.h>
104 #endif
105 #ifdef HAVE_SYS_PARAM_H
106 #include <sys/param.h>
107 #endif
108 #ifdef HAVE_SYS_TYPES_H
109 #include <sys/types.h>
110 #endif
111 #ifdef HAVE_SYS_STAT_H
112 #include <sys/stat.h>
113 #endif
114 #ifdef HAVE_SYS_RESOURCE_H
115 #include <sys/resource.h>
116 #endif
117 #ifdef HAVE_ALLOCA_H
118 #include <alloca.h>
119 #endif
120
121 #undef HAVE_ISSETUGID
122 #undef HAVE_STRLCPY
123 #undef HAVE_STRNSTRN
124 #undef HAVE_OPENPTY
125 #undef HAVE_DECL_OPENPTY
126 #undef HAVE_INET_PTON
127 #undef HAVE_INET_NTOP
128 #undef HAVE_GETOPT
129 #undef HAVE_POLL
130 #undef HAVE_VASPRINTF
131
132 /* Kernel kqueue() support */
133 #undef HAVE_KQUEUE
134 /* Kernel epoll_create() support */
135 #undef HAVE_EPOLL
136 /* Kernel port_create() support */
137 #undef HAVE_PORTS
138
139 /* The number of bytes in a char.  */
140 #undef SIZEOF_CHAR
141
142 /* The number of bytes in a int.  */
143 #undef SIZEOF_INT
144
145 /* The number of bytes in a size_t.  */
146 #undef SIZEOF_SIZE_T
147
148
149 /* The number of bytes in a long int.  */
150 #undef SIZEOF_LONG_INT
151
152 /* The number of bytes in a long long int.  */
153 #undef SIZEOF_LONG_LONG_INT
154
155 /* The number of bytes in a short int.  */
156 #undef SIZEOF_SHORT_INT
157
158 /* The number of bytes in a void *.  */
159 #undef SIZEOF_VOID_P
160
161 /* The number of bytes in a void * (workaround for OpenBSD). */
162 #undef SIZEOF_VOID__
163 #if !defined(SIZEOF_VOID_P) && defined(SIZEOF_VOID__)
164 #  define SIZEOF_VOID_P SIZEOF_VOID__
165 #endif
166
167 #ifndef HAVE_U_INT
168 typedef unsigned int u_int;
169 #endif
170
171 #undef HAVE_INTXX_T
172 #ifndef HAVE_INTXX_T
173 #if (SIZEOF_CHAR == 1)
174 typedef char int8_t;
175 #else
176 #error "8 bit int type not found."
177 #endif
178 #if (SIZEOF_SHORT_INT == 2)
179 typedef short int int16_t;
180 #else
181 #ifdef _CRAY
182 typedef long int16_t;
183 #else
184 #warning "16 bit int type not found."
185 #endif /* _CRAY */
186 #endif
187 #if (SIZEOF_INT == 4)
188 typedef int int32_t;
189 #else
190 #ifdef _CRAY
191 typedef long int32_t;
192 #else
193 #error "32 bit int type not found."
194 #endif /* _CRAY */
195 #endif
196 #endif
197
198 /* If sys/types.h does not supply u_intXX_t, supply them ourselves */
199 #ifndef HAVE_U_INTXX_T
200 #ifdef HAVE_UINTXX_T
201 typedef uint8_t u_int8_t;
202 typedef uint16_t u_int16_t;
203 typedef uint32_t u_int32_t;
204 #define HAVE_U_INTXX_T 1
205 #else
206 #if (SIZEOF_CHAR == 1)
207 typedef unsigned char u_int8_t;
208 #else
209 #error "8 bit int type not found."
210 #endif
211 #if (SIZEOF_SHORT_INT == 2)
212 typedef unsigned short int u_int16_t;
213 #else
214 #ifdef _CRAY
215 typedef unsigned long u_int16_t;
216 #else
217 #warning "16 bit int type not found."
218 #endif
219 #endif
220 #if (SIZEOF_INT == 4)
221 typedef unsigned int u_int32_t;
222 #else
223 #ifdef _CRAY
224 typedef unsigned long u_int32_t;
225 #else
226 #error "32 bit int type not found."
227 #endif
228 #endif
229 #endif
230 #endif
231
232 /* 64-bit types */
233 #ifndef HAVE_INT64_T
234 #if (SIZEOF_LONG_INT == 8)
235 typedef long int int64_t;
236 #define HAVE_INT64_T 1
237 #else
238 #if (SIZEOF_LONG_LONG_INT == 8)
239 typedef long long int int64_t;
240 #define HAVE_INT64_T 1
241 #define HAVE_LONG_LONG_INT
242 #endif
243 #endif
244 #endif
245 #ifndef HAVE_U_INT64_T
246 #if (SIZEOF_LONG_INT == 8)
247 typedef unsigned long int u_int64_t;
248 #define HAVE_U_INT64_T 1
249 #else
250 #if (SIZEOF_LONG_LONG_INT == 8)
251 typedef unsigned long long int u_int64_t;
252 #define HAVE_U_INT64_T 1
253 #endif
254 #endif
255 #endif
256
257 /* BIND, Kerberos and Berkeley DB use __BIT_TYPES_DEFINED__ to protect
258  * against multiple redefinitions of these types (u_int{8,16,32,64}_t)
259  * and so shall we.
260  */
261 #ifndef __BIT_TYPES_DEFINED__
262 #define __BIT_TYPES_DEFINED__
263 #endif
264
265 #if (SIZEOF_VOID_P == 8)
266 typedef u_int64_t vpsized_uint;
267 typedef int64_t vpsized_int;
268 #elif (SIZEOF_VOID_P == 4)
269 typedef u_int32_t vpsized_uint;
270 typedef int32_t vpsized_int;
271 #else
272 #error Unsupported size of void ptr
273 #endif
274
275 #ifndef PATH_MAX
276 #define PATH_MAX MAXPATHLEN
277 #endif
278
279 typedef enum { noit_false = 0, noit_true } noit_boolean;
280
281 #endif
Note: See TracBrowser for help on using the browser.