cdefs.h
001:
002:
003:
004:
005:
006:
007:
008:
009:
010:
011:
012:
013:
014:
015:
016:
017:
018:
019:
020: #ifndef _SYS_CDEFS_H
021: #define _SYS_CDEFS_H 1
022:
023:
024: #ifndef _FEATURES_H
025: # include <features.h>
026: #endif
027:
028:
029:
030:
031: #if defined __GNUC__ && !defined __STDC__
032: # error "You need a ISO C conforming compiler to use the glibc headers"
033: #endif
034:
035:
036: #undef __P
037: #undef __PMT
038:
039: #ifdef __GNUC__
040:
041:
042:
043: # if __GNUC_PREREQ (4, 6) && !defined _LIBC
044: # define __LEAF , __leaf__
045: # define __LEAF_ATTR __attribute__ ((__leaf__))
046: # else
047: # define __LEAF
048: # define __LEAF_ATTR
049: # endif
050:
051:
052:
053:
054:
055:
056: # if !defined __cplusplus && __GNUC_PREREQ (3, 3)
057: # define __THROW __attribute__ ((__nothrow__ __LEAF))
058: # define __THROWNL __attribute__ ((__nothrow__))
059: # define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
060: # else
061: # if defined __cplusplus && __GNUC_PREREQ (2,8)
062: # define __THROW throw ()
063: # define __THROWNL throw ()
064: # define __NTH(fct) __LEAF_ATTR fct throw ()
065: # else
066: # define __THROW
067: # define __THROWNL
068: # define __NTH(fct) fct
069: # endif
070: # endif
071:
072: #else
073:
074: # define __inline
075:
076: # define __THROW
077: # define __THROWNL
078: # define __NTH(fct) fct
079:
080: # define __const const
081: # define __signed signed
082: # define __volatile volatile
083:
084: #endif
085:
086:
087:
088: #define __P(args) args
089: #define __PMT(args) args
090:
091:
092:
093:
094: #define __CONCAT(x,y) x ## y
095: #define __STRING(x) #x
096:
097:
098: #define __ptr_t void *
099: #define __long_double_t long double
100:
101:
102:
103: #ifdef __cplusplus
104: # define __BEGIN_DECLS extern "C" {
105: # define __END_DECLS }
106: #else
107: # define __BEGIN_DECLS
108: # define __END_DECLS
109: #endif
110:
111:
112:
113:
114:
115:
116:
117: #if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES
118: # define __BEGIN_NAMESPACE_STD namespace std {
119: # define __END_NAMESPACE_STD }
120: # define __USING_NAMESPACE_STD(name) using std::name;
121: # define __BEGIN_NAMESPACE_C99 namespace __c99 {
122: # define __END_NAMESPACE_C99 }
123: # define __USING_NAMESPACE_C99(name) using __c99::name;
124: #else
125:
126:
127:
128: # define __BEGIN_NAMESPACE_STD
129: # define __END_NAMESPACE_STD
130: # define __USING_NAMESPACE_STD(name)
131: # define __BEGIN_NAMESPACE_C99
132: # define __END_NAMESPACE_C99
133: # define __USING_NAMESPACE_C99(name)
134: #endif
135:
136:
137:
138: #ifndef __BOUNDED_POINTERS__
139: # define __bounded
140: # define __unbounded
141: # define __ptrvalue
142: #endif
143:
144:
145:
146: #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
147: #define __bos0(ptr) __builtin_object_size (ptr, 0)
148:
149: #if __GNUC_PREREQ (4,3)
150: # define __warndecl(name, msg) \
151: extern void name (void) __attribute__((__warning__ (msg)))
152: # define __warnattr(msg) __attribute__((__warning__ (msg)))
153: # define __errordecl(name, msg) \
154: extern void name (void) __attribute__((__error__ (msg)))
155: #else
156: # define __warndecl(name, msg) extern void name (void)
157: # define __warnattr(msg)
158: # define __errordecl(name, msg) extern void name (void)
159: #endif
160:
161:
162: #if __GNUC_PREREQ (2,97)
163:
164: # define __flexarr []
165: #else
166: # ifdef __GNUC__
167: # define __flexarr [0]
168: # else
169: # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
170: # define __flexarr []
171: # else
172:
173: # define __flexarr [1]
174: # endif
175: # endif
176: #endif
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189: #if defined __GNUC__ && __GNUC__ >= 2
190:
191: # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias))
192: # ifdef __cplusplus
193: # define __REDIRECT_NTH(name, proto, alias) \
194: name proto __THROW __asm__ (__ASMNAME (#alias))
195: # define __REDIRECT_NTHNL(name, proto, alias) \
196: name proto __THROWNL __asm__ (__ASMNAME (#alias))
197: # else
198: # define __REDIRECT_NTH(name, proto, alias) \
199: name proto __asm__ (__ASMNAME (#alias)) __THROW
200: # define __REDIRECT_NTHNL(name, proto, alias) \
201: name proto __asm__ (__ASMNAME (#alias)) __THROWNL
202: # endif
203: # define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
204: # define __ASMNAME2(prefix, cname) __STRING (prefix) cname
205:
206:
207:
208:
209:
210:
211:
212: #endif
213:
214:
215:
216:
217: #if !defined __GNUC__ || __GNUC__ < 2
218: # define __attribute__(xyz)
219: #endif
220:
221:
222:
223:
224: #if __GNUC_PREREQ (2,96)
225: # define __attribute_malloc__ __attribute__ ((__malloc__))
226: #else
227: # define __attribute_malloc__
228: #endif
229:
230:
231:
232:
233: #if __GNUC_PREREQ (2,96)
234: # define __attribute_pure__ __attribute__ ((__pure__))
235: #else
236: # define __attribute_pure__
237: #endif
238:
239:
240: #if __GNUC_PREREQ (2,5)
241: # define __attribute_const__ __attribute__ ((__const__))
242: #else
243: # define __attribute_const__
244: #endif
245:
246:
247:
248:
249: #if __GNUC_PREREQ (3,1)
250: # define __attribute_used__ __attribute__ ((__used__))
251: # define __attribute_noinline__ __attribute__ ((__noinline__))
252: #else
253: # define __attribute_used__ __attribute__ ((__unused__))
254: # define __attribute_noinline__
255: #endif
256:
257:
258: #if __GNUC_PREREQ (3,2)
259: # define __attribute_deprecated__ __attribute__ ((__deprecated__))
260: #else
261: # define __attribute_deprecated__
262: #endif
263:
264:
265:
266:
267:
268:
269:
270: #if __GNUC_PREREQ (2,8)
271: # define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x)))
272: #else
273: # define __attribute_format_arg__(x)
274: #endif
275:
276:
277:
278:
279:
280: #if __GNUC_PREREQ (2,97)
281: # define __attribute_format_strfmon__(a,b) \
282: __attribute__ ((__format__ (__strfmon__, a, b)))
283: #else
284: # define __attribute_format_strfmon__(a,b)
285: #endif
286:
287:
288:
289: #if __GNUC_PREREQ (3,3)
290: # define __nonnull(params) __attribute__ ((__nonnull__ params))
291: #else
292: # define __nonnull(params)
293: #endif
294:
295:
296:
297: #if __GNUC_PREREQ (3,4)
298: # define __attribute_warn_unused_result__ \
299: __attribute__ ((__warn_unused_result__))
300: # if __USE_FORTIFY_LEVEL > 0
301: # define __wur __attribute_warn_unused_result__
302: # endif
303: #else
304: # define __attribute_warn_unused_result__
305: #endif
306: #ifndef __wur
307: # define __wur
308: #endif
309:
310:
311: #if __GNUC_PREREQ (3,2)
312: # define __always_inline __inline __attribute__ ((__always_inline__))
313: #else
314: # define __always_inline __inline
315: #endif
316:
317:
318:
319: #if !defined __cplusplus || __GNUC_PREREQ (4,3)
320: # if defined __GNUC_STDC_INLINE__ || defined __cplusplus
321: # define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
322: # if __GNUC_PREREQ (4,3)
323: # define __extern_always_inline \
324: extern __always_inline __attribute__ ((__gnu_inline__, __artificial__))
325: # else
326: # define __extern_always_inline \
327: extern __always_inline __attribute__ ((__gnu_inline__))
328: # endif
329: # else
330: # define __extern_inline extern __inline
331: # if __GNUC_PREREQ (4,3)
332: # define __extern_always_inline \
333: extern __always_inline __attribute__ ((__artificial__))
334: # else
335: # define __extern_always_inline extern __always_inline
336: # endif
337: # endif
338: #endif
339:
340:
341:
342: #if __GNUC_PREREQ (4,3)
343: # define __va_arg_pack() __builtin_va_arg_pack ()
344: # define __va_arg_pack_len() __builtin_va_arg_pack_len ()
345: #endif
346:
347:
348:
349:
350:
351: #if !__GNUC_PREREQ (2,8)
352: # define __extension__
353: #endif
354:
355:
356: #if !__GNUC_PREREQ (2,92)
357: # define __restrict
358: #endif
359:
360:
361:
362:
363: #if __GNUC_PREREQ (3,1) && !defined __GNUG__
364: # define __restrict_arr __restrict
365: #else
366: # ifdef __GNUC__
367: # define __restrict_arr
368: # else
369: # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
370: # define __restrict_arr restrict
371: # else
372:
373: # define __restrict_arr
374: # endif
375: # endif
376: #endif
377:
378: #include <bits/wordsize.h>
379:
380: #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
381: # define __LDBL_COMPAT 1
382: # ifdef __REDIRECT
383: # define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias)
384: # define __LDBL_REDIR(name, proto) \
385: __LDBL_REDIR1 (name, proto, __nldbl_##name)
386: # define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias)
387: # define __LDBL_REDIR_NTH(name, proto) \
388: __LDBL_REDIR1_NTH (name, proto, __nldbl_##name)
389: # define __LDBL_REDIR1_DECL(name, alias) \
390: extern __typeof (name) name __asm (__ASMNAME (#alias));
391: # define __LDBL_REDIR_DECL(name) \
392: extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name));
393: # define __REDIRECT_LDBL(name, proto, alias) \
394: __LDBL_REDIR1 (name, proto, __nldbl_##alias)
395: # define __REDIRECT_NTH_LDBL(name, proto, alias) \
396: __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias)
397: # endif
398: #endif
399: #if !defined __LDBL_COMPAT || !defined __REDIRECT
400: # define __LDBL_REDIR1(name, proto, alias) name proto
401: # define __LDBL_REDIR(name, proto) name proto
402: # define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW
403: # define __LDBL_REDIR_NTH(name, proto) name proto __THROW
404: # define __LDBL_REDIR_DECL(name)
405: # ifdef __REDIRECT
406: # define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias)
407: # define __REDIRECT_NTH_LDBL(name, proto, alias) \
408: __REDIRECT_NTH (name, proto, alias)
409: # endif
410: #endif
411:
412: #endif
413:
© Andrew Scott 2006 -
2024,
All Rights Reserved