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