misc quota proc->thread
[dragonfly.git] / sys / i386 / boot / dosboot / cdefs.h
1 /*\r
2  * Copyright (c) 1991, 1993\r
3  *      The Regents of the University of California.  All rights reserved.\r
4  *\r
5  * Redistribution and use in source and binary forms, with or without\r
6  * modification, are permitted provided that the following conditions\r
7  * are met:\r
8  * 1. Redistributions of source code must retain the above copyright\r
9  *    notice, this list of conditions and the following disclaimer.\r
10  * 2. Redistributions in binary form must reproduce the above copyright\r
11  *    notice, this list of conditions and the following disclaimer in the\r
12  *    documentation and/or other materials provided with the distribution.\r
13  * 3. All advertising materials mentioning features or use of this software\r
14  *    must display the following acknowledgement:\r
15  *      This product includes software developed by the University of\r
16  *      California, Berkeley and its contributors.\r
17  * 4. Neither the name of the University nor the names of its contributors\r
18  *    may be used to endorse or promote products derived from this software\r
19  *    without specific prior written permission.\r
20  *\r
21  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
31  * SUCH DAMAGE.\r
32  *\r
33  *      from: @(#)cdefs.h       8.1 (Berkeley) 6/2/93\r
34  * $FreeBSD: src/sys/i386/boot/dosboot/cdefs.h,v 1.5 1999/08/28 00:43:21 peter Exp $\r
35  * $DragonFly: src/sys/i386/boot/dosboot/Attic/cdefs.h,v 1.2 2003/06/17 04:28:34 dillon Exp $\r
36  */\r
37 \r
38 #ifndef _CDEFS_H_\r
39 #define _CDEFS_H_\r
40 \r
41 #if defined(__cplusplus)\r
42 #define __BEGIN_DECLS   extern "C" {\r
43 #define __END_DECLS     };\r
44 #else\r
45 #define __BEGIN_DECLS\r
46 #define __END_DECLS\r
47 #endif\r
48 \r
49 /*\r
50  * The __CONCAT macro is used to concatenate parts of symbol names, e.g.\r
51  * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.\r
52  * The __CONCAT macro is a bit tricky -- make sure you don't put spaces\r
53  * in between its arguments.  __CONCAT can also concatenate double-quoted\r
54  * strings produced by the __STRING macro, but this only works with ANSI C.\r
55  */\r
56 #if defined(__STDC__) || defined(__cplusplus)\r
57 #if defined(__P)\r
58 #undef __P\r
59 #endif  /* defined(__P) */\r
60 #define __P(protos)     protos          /* full-blown ANSI C */\r
61 #define __CONCAT(x,y)   x ## y\r
62 #define __STRING(x)     #x\r
63 \r
64 #else   /* !(__STDC__ || __cplusplus) */\r
65 #if defined(__P)\r
66 #undef __P\r
67 #endif  /* defined(__P) */\r
68 #define __P(protos)     ()              /* traditional C preprocessor */\r
69 #define __CONCAT(x,y)   x/**/y\r
70 #define __STRING(x)     "x"\r
71 \r
72 /* delete ANSI C keywords */\r
73 #define const                           \r
74 #define inline\r
75 #define signed\r
76 #define volatile\r
77 #endif  /* !(__STDC__ || __cplusplus) */\r
78 \r
79 /*\r
80  * GCC has extensions for declaring functions as const (`pure' - always returns\r
81  * the same value given the same inputs, i.e., has no external state and\r
82  * no side effects) and volatile (nonreturning or `dead').\r
83  * These mainly affect optimization and warnings.  \r
84  *\r
85  * To facilitate portability of a non-standard extension we define __pure\r
86  * and __dead and use these for qualifying functions. Non-gcc compilers\r
87  * which have similar extensions can then define these appropriately.\r
88  *\r
89  * Unfortunately, GCC complains if these are used under strict ANSI mode \r
90  * (`gcc -ansi -pedantic'), hence we need to define them only if compiling \r
91  * without this.\r
92  */\r
93 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)\r
94 #define __dead __volatile\r
95 #define __pure __const\r
96 #else\r
97 #define __dead\r
98 #define __pure\r
99 #endif\r
100 \r
101 #endif /* !_CDEFS_H_ */\r