1/* Process this file with configure to produce config.h. -*- mode: c -*- */
2#ifndef CLICK_CONFIG_H
3#define CLICK_CONFIG_H
4
5/* Define to 1 if type `char' is unsigned and you are not using gcc.  */
6#ifndef __CHAR_UNSIGNED__
7# undef __CHAR_UNSIGNED__
8#endif
9
10#define CLICK_BIG_ENDIAN	4321
11#define CLICK_LITTLE_ENDIAN	1234
12#define CLICK_NO_ENDIAN		0
13
14/* Define to byte order of target machine. */
15#undef CLICK_BYTE_ORDER
16
17/* Define to enable debugging support for Click scheduling. */
18#undef CLICK_DEBUG_SCHEDULING
19
20/* Define for Click memory allocation debugging. */
21#undef CLICK_DMALLOC
22
23/* Define to generate smaller object files. */
24#undef CLICK_OPTIMIZE_SIZE
25
26/* Version number of package */
27#undef CLICK_VERSION
28
29/* Version number of package, in CLICK_MAKE_VERSION_CODE format */
30#undef CLICK_VERSION_CODE
31
32/* Define to desired statistics level. */
33#undef CLICK_STATS
34
35/* Define if PollDevice should run fast to get good benchmark numbers */
36#undef CLICK_WARP9
37
38/* Define if you have the __builtin_clz function. */
39#undef HAVE___BUILTIN_CLZ
40
41/* Define if you have the __builtin_clzl function. */
42#undef HAVE___BUILTIN_CLZL
43
44/* Define if you have the __builtin_clzll function. */
45#undef HAVE___BUILTIN_CLZLL
46
47/* Define if you have the __builtin_ffs function. */
48#undef HAVE___BUILTIN_FFS
49
50/* Define if you have the __builtin_ffsl function. */
51#undef HAVE___BUILTIN_FFSL
52
53/* Define if you have the __builtin_ffsll function. */
54#undef HAVE___BUILTIN_FFSLL
55
56/* Define if you have the __has_trivial_copy compiler intrinsic. */
57#undef HAVE___HAS_TRIVIAL_COPY
58
59/* Define if you have the __sync_synchronize function. */
60#undef HAVE___SYNC_SYNCHRONIZE
61
62/* Define if the __sync_synchronize function supports arguments. */
63#undef HAVE___SYNC_SYNCHRONIZE_ARGUMENTS
64
65/* Define if the va_list type is addressable. */
66#undef HAVE_ADDRESSABLE_VA_LIST
67
68/* Define if right shift of signed integers acts by sign extension. */
69#undef HAVE_ARITHMETIC_RIGHT_SHIFT
70
71/* Define if Port::push/Port::pull should use bound function pointers. */
72#undef HAVE_BOUND_PORT_TRANSFER
73
74/* Define if the C++ compiler understands constexpr. */
75#undef HAVE_CXX_CONSTEXPR
76
77/* Define if the C++ compiler understands #pragma interface. */
78#undef HAVE_CXX_PRAGMA_INTERFACE
79
80/* Define if the C++ compiler understands rvalue references. */
81#undef HAVE_CXX_RVALUE_REFERENCES
82
83/* Define if the C++ compiler understands static_assert. */
84#undef HAVE_CXX_STATIC_ASSERT
85
86/* Define if the C++ compiler understands template alias. */
87#undef HAVE_CXX_TEMPLATE_ALIAS
88
89/* Define if the machine is indifferent to alignment. */
90#undef HAVE_INDIFFERENT_ALIGNMENT
91
92/* Define if you want to use Intel-specific instructions. */
93#undef HAVE_INTEL_CPU
94
95/* Define if 64-bit integer types are enabled. */
96#undef HAVE_INT64_TYPES
97
98/* Define if IPv6 support is enabled. */
99#undef HAVE_IP6
100
101/* Define if IPsec support is enabled. */
102#undef HAVE_IPSEC
103
104/* Define to 1 if the system has the type `long long'. */
105#undef HAVE_LONG_LONG
106
107/* Define if nanosecond-granularity timestamps are enabled. */
108#undef HAVE_NANOTIMESTAMP_ENABLED
109
110/* Define if you want to use the stride scheduler. */
111#undef HAVE_STRIDE_SCHED
112
113/* Define to 1 since we have Strings. */
114#define HAVE_STRING 1
115
116/* Define to 1 if the system has the type `struct timespec'. */
117#undef HAVE_STRUCT_TIMESPEC
118
119#ifdef HAVE_STRIDE_SCHED
120/* Define if you want task scheduling to use a heap, not a linked list. */
121#undef HAVE_TASK_HEAP
122#endif
123
124/* The size of a `int', as computed by sizeof. */
125#undef SIZEOF_INT
126
127/* The size of a `long', as computed by sizeof. */
128#undef SIZEOF_LONG
129
130/* The size of a `long long', as computed by sizeof. */
131#undef SIZEOF_LONG_LONG
132
133/* The size of a `size_t', as computed by sizeof. */
134#undef SIZEOF_SIZE_T
135
136/* The size of a `struct timespec', as computed by sizeof. */
137#undef SIZEOF_STRUCT_TIMESPEC
138
139/* The size of a `struct timeval', as computed by sizeof. */
140#undef SIZEOF_STRUCT_TIMEVAL
141
142/* The size of a `ptrdiff_t', as computed by sizeof. */
143#undef SIZEOF_PTRDIFF_T
144
145/* The size of a `void *', as computed by sizeof. */
146#undef SIZEOF_VOID_P
147
148/* Define if you want to run multithreaded Click. */
149#undef __MTCLICK__
150
151/* Define inline, if necessary. C only. */
152#ifndef __cplusplus
153#undef inline
154#endif
155
156/* Define constexpr to const under C or old C++. */
157#if !defined(__cplusplus) || !HAVE_CXX_CONSTEXPR
158# define constexpr const
159#endif
160
161/* Define CLICK_DEBUG_SCHEDULING to 0 if disabled. */
162#ifndef CLICK_DEBUG_SCHEDULING
163# define CLICK_DEBUG_SCHEDULING 0
164#endif
165
166/* Define macro for creating Click version codes (a la Linux version codes). */
167#define CLICK_MAKE_VERSION_CODE(major, minor, patch) \
168		(((major) << 16) | ((minor) << 8) | (patch))
169
170/* Define macro for aligning variables. */
171#if __GNUC__
172# define CLICK_ALIGNED(x) __attribute__((aligned(x)))
173#else
174# define CLICK_ALIGNED(x) /* nothing */
175#endif
176
177/* Define macro for size of a cache line. */
178#define CLICK_CACHE_LINE_SIZE 64
179
180/* Define macro for the difference between 'x' and the next higher multiple
181   of CLICK_CACHE_LINE_SIZE (between 0 and CLICK_CACHE_LINE_SIZE - 1). */
182#define CLICK_CACHE_LINE_PAD_BYTES(x) \
183	((((x) + CLICK_CACHE_LINE_SIZE - 1) / CLICK_CACHE_LINE_SIZE) * CLICK_CACHE_LINE_SIZE - (x))
184
185/* Define macro for deprecated functions. */
186#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ == 0)
187# define CLICK_DEPRECATED /* nothing */
188#else
189# define CLICK_DEPRECATED __attribute__((deprecated))
190#endif
191
192/* Define macro for deprecated functions with message. */
193#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ == 0)
194# define CLICK_DEPRECATED_MSG(m) /* nothing */
195#elif __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 4)
196# define CLICK_DEPRECATED_MSG(m) __attribute__((deprecated))
197#else
198# define CLICK_DEPRECATED_MSG(m) __attribute__((deprecated(m)))
199#endif
200
201/* Define macro for deprecated enumerations. */
202#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)
203# define CLICK_DEPRECATED_ENUM /* nothing */
204#else
205# define CLICK_DEPRECATED_ENUM __attribute__((deprecated))
206#endif
207
208/* Define macros for marking types as may-alias. */
209#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
210# define CLICK_MAY_ALIAS /* nothing */
211#else
212# define CLICK_MAY_ALIAS __attribute__((__may_alias__))
213#endif
214
215/* Define macro for marking functions noninlinable. */
216#ifdef CLICK_LINUXMODULE
217# define CLICK_NOINLINE noinline
218#elif __GNUC__
219# define CLICK_NOINLINE __attribute__((noinline))
220#else
221# define CLICK_NOINLINE /* nothing */
222#endif
223
224/* Define macro for funtions that should be inline-able even if compiling without optimization. */
225#if __GNUC__
226# define CLICK_ALWAYS_INLINE __attribute__((always_inline))
227#else
228# define CLICK_ALWAYS_INLINE /* nothing */
229#endif
230
231/* Define macros for declaring packed structures. */
232#ifdef __GNUC__
233# define CLICK_PACKED_STRUCTURE(open, close) open close __attribute__((packed))
234# define CLICK_SIZE_PACKED_STRUCTURE(open, close) open close __attribute__((packed)) /* deprecated */
235# define CLICK_SIZE_PACKED_ATTRIBUTE __attribute__((packed))
236#else
237# define CLICK_PACKED_STRUCTURE(open, close) _Cannot_pack_structure__Use_GCC
238# define CLICK_SIZE_PACKED_STRUCTURE(open, close) open close /* deprecated */
239# define CLICK_SIZE_PACKED_ATTRIBUTE
240#endif
241
242/* Define macro for functions whose results should not be ignored. */
243#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)
244# define CLICK_WARN_UNUSED_RESULT /* nothing */
245#else
246# define CLICK_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
247#endif
248
249/* Define macro for cold (rarely used) functions. */
250#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
251# define CLICK_COLD /* nothing */
252#else
253# define CLICK_COLD __attribute__((cold))
254#endif
255
256/* Define ARCH_IS_BIG_ENDIAN based on CLICK_BYTE_ORDER. */
257#if CLICK_BYTE_ORDER == CLICK_BIG_ENDIAN
258# define ARCH_IS_BIG_ENDIAN	1
259#elif CLICK_BYTE_ORDER == CLICK_LITTLE_ENDIAN
260# define ARCH_IS_BIG_ENDIAN	0
261#endif
262
263/* Define macro for htons() on constants (allows htons() in switch cases). */
264#if CLICK_BYTE_ORDER == CLICK_BIG_ENDIAN
265# define click_constant_htons(x)	(x)
266#elif CLICK_BYTE_ORDER == CLICK_LITTLE_ENDIAN
267# define click_constant_htons(x)	((((x) >> 8) & 255) | (((x) & 255) << 8))
268#endif
269
270/* EXPORT_ELEMENT, ELEMENT_REQUIRES, ELEMENT_PROVIDES, ELEMENT_HEADER,
271   ELEMENT_LIBS, and ELEMENT_MT_SAFE are noops. */
272#define EXPORT_ELEMENT(x)
273#define ELEMENT_REQUIRES(x)
274#define ELEMENT_PROVIDES(x)
275#define ELEMENT_HEADER(x)
276#define ELEMENT_LIBS(x)
277#define ELEMENT_MT_SAFE(x)
278
279/* Assume CLICK_USERLEVEL unless otherwise defined. */
280#if !defined(CLICK_USERLEVEL) && !defined(CLICK_TOOL) && !defined(CLICK_LINUXMODULE) && !defined(CLICK_BSDMODULE) && !defined(CLICK_MINIOS)
281# define CLICK_USERLEVEL 1
282#endif
283
284/* Define stuff under a Linux module. */
285#ifdef CLICK_LINUXMODULE
286# include <click/config-linuxmodule.h>
287#endif
288
289/* Define stuff under a FreeBSD module. */
290#ifdef CLICK_BSDMODULE
291# include <click/config-bsdmodule.h>
292#endif
293
294/* Define stuff under nsclick. */
295#ifdef CLICK_NS
296# include <click/config-ns.h>
297#endif
298
299/* Define stuff under tools or a user-level driver. */
300#if defined(CLICK_USERLEVEL) || defined(CLICK_TOOL)
301# include <click/config-userlevel.h>
302#endif
303
304/* Define stuff under a MiniOS application. */
305#ifdef CLICK_MINIOS
306# include <click/config-minios.h>
307#endif
308
309/* Ensure declaration of DefaultArg template. */
310#ifdef __cplusplus
311CLICK_DECLS
312template <typename T> struct DefaultArg;
313
314/** @class uninitialized_type
315    @brief Type tag indicating an object should not be initialized. */
316struct uninitialized_type {
317};
318CLICK_ENDDECLS
319#endif
320
321/* Define aliasing versions of integer and pointer types. */
322typedef uint16_t click_aliasable_uint16_t CLICK_MAY_ALIAS;
323typedef int16_t click_aliasable_int16_t CLICK_MAY_ALIAS;
324typedef uint32_t click_aliasable_uint32_t CLICK_MAY_ALIAS;
325typedef int32_t click_aliasable_int32_t CLICK_MAY_ALIAS;
326#if HAVE_INT64_TYPES
327typedef uint64_t click_aliasable_uint64_t CLICK_MAY_ALIAS;
328typedef int64_t click_aliasable_int64_t CLICK_MAY_ALIAS;
329#endif
330typedef void *click_aliasable_void_pointer_t CLICK_MAY_ALIAS;
331
332#endif /* CLICK_CONFIG_H */
333