Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | pj | 1 | /* Copyright (C) 1992,93,94,95,96,97,98,99 Free Software Foundation, Inc. |
2 | This file is part of the GNU C Library. |
||
3 | |||
4 | The GNU C Library is free software; you can redistribute it and/or |
||
5 | modify it under the terms of the GNU Library General Public License as |
||
6 | published by the Free Software Foundation; either version 2 of the |
||
7 | License, or (at your option) any later version. |
||
8 | |||
9 | The GNU C Library is distributed in the hope that it will be useful, |
||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||
12 | Library General Public License for more details. |
||
13 | |||
14 | You should have received a copy of the GNU Library General Public |
||
15 | License along with the GNU C Library; see the file COPYING.LIB. If not, |
||
16 | write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
||
17 | Boston, MA 02111-1307, USA. */ |
||
18 | |||
19 | #ifndef _SYS_CDEFS_H |
||
20 | #define _SYS_CDEFS_H 1 |
||
21 | |||
22 | #include <ll/sys/cdefs.h> |
||
23 | |||
24 | /* MODIFIED by this add */ |
||
25 | /*#define __warn_references(func,str)*/ |
||
26 | |||
27 | /* We are almost always included from features.h. */ |
||
28 | #ifndef _FEATURES_H |
||
29 | #include <features.h> |
||
30 | #endif |
||
31 | |||
32 | /* Some user header file might have defined this before. */ |
||
33 | #undef __P |
||
34 | #undef __PMT |
||
35 | |||
36 | #ifdef __GNUC__ |
||
37 | |||
38 | /* GCC can always grok prototypes. For C++ programs we add throw() |
||
39 | to help it optimize the function calls. But this works only with |
||
40 | gcc 2.8.x and egcs. */ |
||
41 | # if defined __cplusplus && (__GNUC__ >= 3 || __GNUC_MINOR__ >= 8) |
||
42 | # define __THROW throw () |
||
43 | # else |
||
44 | # define __THROW |
||
45 | # endif |
||
46 | # define __P(args) args __THROW |
||
47 | /* This macro will be used for functions which might take C++ callback |
||
48 | functions. */ |
||
49 | # define __PMT(args) args |
||
50 | # define __DOTS , ... |
||
51 | |||
52 | #else /* Not GCC. */ |
||
53 | |||
54 | # define __inline /* No inline functions. */ |
||
55 | |||
56 | # if (defined __STDC__ && __STDC__) || defined __cplusplus |
||
57 | |||
58 | # define __P(args) args |
||
59 | # define __PMT(args) args |
||
60 | # define __const const |
||
61 | # define __signed signed |
||
62 | # define __volatile volatile |
||
63 | # define __DOTS , ... |
||
64 | |||
65 | # else /* Not ANSI C or C++. */ |
||
66 | |||
67 | # define __P(args) () /* No prototypes. */ |
||
68 | # define __PMT(args) () |
||
69 | # define __const /* No ANSI C keywords. */ |
||
70 | # define __signed |
||
71 | # define __volatile |
||
72 | # define __DOTS |
||
73 | |||
74 | # endif /* ANSI C or C++. */ |
||
75 | |||
76 | #endif /* GCC. */ |
||
77 | |||
78 | /* For these things, GCC behaves the ANSI way normally, |
||
79 | and the non-ANSI way under -traditional. */ |
||
80 | |||
81 | #if defined __STDC__ && __STDC__ |
||
82 | |||
83 | //# define __CONCAT(x,y) x ## y |
||
84 | # define __STRING(x) #x |
||
85 | |||
86 | /* This is not a typedef so `const __ptr_t' does the right thing. */ |
||
87 | # define __ptr_t void * |
||
88 | # define __long_double_t long double |
||
89 | |||
90 | #else |
||
91 | |||
92 | //# define __CONCAT(x,y) x/**/y |
||
93 | # define __STRING(x) "x" |
||
94 | |||
95 | # define __ptr_t char * |
||
96 | # define __long_double_t long double |
||
97 | |||
98 | /* The BSD header files use the ANSI keywords unmodified (this means that |
||
99 | old programs may lose if they use the new keywords as identifiers), but |
||
100 | those names are not available under -traditional. We define them to |
||
101 | their __ versions, which are taken care of above. */ |
||
102 | #ifdef __USE_BSD |
||
103 | # define const __const |
||
104 | # define signed __signed |
||
105 | # define volatile __volatile |
||
106 | #endif |
||
107 | |||
108 | #endif /* __STDC__ */ |
||
109 | |||
110 | |||
111 | /* C++ needs to know that types and declarations are C, not C++. */ |
||
112 | #ifdef __cplusplus |
||
113 | # define __BEGIN_DECLS extern "C" { |
||
114 | # define __END_DECLS } |
||
115 | #else |
||
116 | # define __BEGIN_DECLS |
||
117 | # define __END_DECLS |
||
118 | #endif |
||
119 | |||
120 | /* __asm__ ("xyz") is used throughout the headers to rename functions |
||
121 | at the assembly language level. This is wrapped by the __REDIRECT |
||
122 | macro, in order to support compilers that can do this some other |
||
123 | way. When compilers don't support asm-names at all, we have to do |
||
124 | preprocessor tricks instead (which don't have exactly the right |
||
125 | semantics, but it's the best we can do). |
||
126 | |||
127 | Example: |
||
128 | int __REDIRECT(setpgrp, __P((__pid_t pid, __pid_t pgrp)), setpgid); */ |
||
129 | |||
130 | #if defined __GNUC__ && __GNUC__ >= 2 |
||
131 | |||
132 | # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) |
||
133 | # define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) |
||
134 | # define __ASMNAME2(prefix, cname) __STRING (prefix) cname |
||
135 | |||
136 | /* |
||
137 | #elif __SOME_OTHER_COMPILER__ |
||
138 | |||
139 | # define __attribute__(xyz) |
||
140 | # define __REDIRECT(name, proto, alias) name proto; \ |
||
141 | _Pragma("let " #name " = " #alias) |
||
142 | */ |
||
143 | #endif |
||
144 | |||
145 | /* GCC has various useful declarations that can be made with the |
||
146 | `__attribute__' syntax. All of the ways we use this do fine if |
||
147 | they are omitted for compilers that don't understand it. */ |
||
148 | #if !defined __GNUC__ || __GNUC__ < 2 |
||
149 | |||
150 | # define __attribute__(xyz) /* Ignore. */ |
||
151 | |||
152 | #endif |
||
153 | |||
154 | /* It is possible to compile containing GCC extensions even if GCC is |
||
155 | run in pedantic mode if the uses are carefully marked using the |
||
156 | `__extension__' keyword. But this is not generally available before |
||
157 | version 2.8. */ |
||
158 | #if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) |
||
159 | |||
160 | # define __extension__ /* Ignore */ |
||
161 | |||
162 | #endif |
||
163 | |||
164 | /* __restrict is known in EGCS 1.2 and above. */ |
||
165 | #if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 92) |
||
166 | |||
167 | # define __restrict /* Ignore */ |
||
168 | |||
169 | #endif |
||
170 | |||
171 | #endif /* sys/cdefs.h */ |