1 //==========================================================================
7 //==========================================================================
8 //####BSDCOPYRIGHTBEGIN####
10 // -------------------------------------------
12 // Portions of this software may have been derived from OpenBSD or other sources,
13 // and are covered by the appropriate copyright disclaimers included herein.
15 // -------------------------------------------
17 //####BSDCOPYRIGHTEND####
18 //==========================================================================
19 //#####DESCRIPTIONBEGIN####
22 // Contributors: gthomas
28 //####DESCRIPTIONEND####
30 //==========================================================================
33 /* $OpenBSD: cdefs.h,v 1.5 1996/09/27 17:34:44 maja Exp $ */
34 /* $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ */
37 * Copyright (c) 1991, 1993
38 * The Regents of the University of California. All rights reserved.
40 * This code is derived from software contributed to Berkeley by
41 * Berkeley Software Design, Inc.
43 * Redistribution and use in source and binary forms, with or without
44 * modification, are permitted provided that the following conditions
46 * 1. Redistributions of source code must retain the above copyright
47 * notice, this list of conditions and the following disclaimer.
48 * 2. Redistributions in binary form must reproduce the above copyright
49 * notice, this list of conditions and the following disclaimer in the
50 * documentation and/or other materials provided with the distribution.
51 * 3. All advertising materials mentioning features or use of this software
52 * must display the following acknowledgement:
53 * This product includes software developed by the University of
54 * California, Berkeley and its contributors.
55 * 4. Neither the name of the University nor the names of its contributors
56 * may be used to endorse or promote products derived from this software
57 * without specific prior written permission.
59 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
60 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
61 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
62 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
63 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
64 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
65 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
66 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
67 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
68 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
71 * @(#)cdefs.h 8.7 (Berkeley) 1/21/94
78 * Gratuitous NetBSD gcc extensions we can do without.
81 #ifdef __KPRINTF_ATTRIBUTE__
82 #undef __KPRINTF_ATTRIBUTE__
85 #include <machine/cdefs.h>
87 #if defined(__cplusplus)
88 #define __BEGIN_DECLS extern "C" {
89 #define __END_DECLS };
96 * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
97 * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
98 * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
99 * in between its arguments. __CONCAT can also concatenate double-quoted
100 * strings produced by the __STRING macro, but this only works with ANSI C.
102 #if defined(__STDC__) || defined(__cplusplus)
103 #define __P(protos) protos /* full-blown ANSI C */
104 #define __CONCAT(x,y) x ## y
105 #define __STRING(x) #x
107 #define __const const /* define reserved names to standard */
108 #define __signed signed
109 #define __volatile volatile
110 #if defined(__cplusplus)
111 #define __inline inline /* convert to C++ keyword */
113 #if !defined(__GNUC__) && !defined(lint)
114 #define __inline /* delete GCC keyword */
115 #endif /* !__GNUC__ && !lint */
116 #endif /* !__cplusplus */
118 #else /* !(__STDC__ || __cplusplus) */
119 #define __P(protos) () /* traditional C preprocessor */
120 #define __CONCAT(x,y) x/**/y
121 #define __STRING(x) "x"
123 #if !defined(__GNUC__) && !defined(lint)
124 #define __const /* delete pseudo-ANSI C keywords */
128 #endif /* !__GNUC__ && !lint */
131 * In non-ANSI C environments, new programs will want ANSI-only C keywords
132 * deleted from the program and old programs will want them left alone.
133 * Programs using the ANSI C keywords const, inline etc. as normal
134 * identifiers should define -DNO_ANSI_KEYWORDS.
136 #ifndef NO_ANSI_KEYWORDS
137 #define const __const /* convert ANSI C keywords */
138 #define inline __inline
139 #define signed __signed
140 #define volatile __volatile
141 #endif /* !NO_ANSI_KEYWORDS */
142 #endif /* !(__STDC__ || __cplusplus) */
145 * GCC1 and some versions of GCC2 declare dead (non-returning) and
146 * pure (no side effects) functions using "volatile" and "const";
147 * unfortunately, these then cause warnings under "-ansi -pedantic".
148 * GCC2 uses a new, peculiar __attribute__((attrs)) style. All of
149 * these work for GNU C++ (modulo a slight glitch in the C++ grammar
150 * in the distribution version of 2.5.5).
152 #if !defined(__GNUC__) || __GNUC__ < 2 || \
153 (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
154 #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */
155 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
156 #define __dead __volatile
157 #define __pure __const
161 #ifdef __KPRINTF_ATTRIBUTE__
162 #define __kprintf_attribute__(a) __attribute__(a)
164 #define __kprintf_attribute__(a)
167 /* Delete pseudo-keywords wherever they are not available or needed. */
173 #endif /* !_SYS_CDEFS_H_ */