1 | /* stdc.h -- macros to make source compile on both ANSI C and K&R C
|
---|
2 | compilers. */
|
---|
3 |
|
---|
4 | /* Copyright (C) 1993 Free Software Foundation, Inc.
|
---|
5 |
|
---|
6 | This file is part of GNU Bash, the Bourne Again SHell.
|
---|
7 |
|
---|
8 | Bash is free software; you can redistribute it and/or modify it
|
---|
9 | under the terms of the GNU General Public License as published by
|
---|
10 | the Free Software Foundation; either version 2, or (at your option)
|
---|
11 | any later version.
|
---|
12 |
|
---|
13 | Bash is distributed in the hope that it will be useful, but WITHOUT
|
---|
14 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
---|
15 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
---|
16 | License for more details.
|
---|
17 |
|
---|
18 | You should have received a copy of the GNU General Public License
|
---|
19 | along with Bash; see the file COPYING. If not, write to the Free
|
---|
20 | Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
|
---|
21 |
|
---|
22 | #if !defined (_STDC_H_)
|
---|
23 | #define _STDC_H_
|
---|
24 |
|
---|
25 | /* Adapted from BSD /usr/include/sys/cdefs.h. */
|
---|
26 |
|
---|
27 | /* A function can be defined using prototypes and compile on both ANSI C
|
---|
28 | and traditional C compilers with something like this:
|
---|
29 | extern char *func __P((char *, char *, int)); */
|
---|
30 |
|
---|
31 | #if !defined (__P)
|
---|
32 | # if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) || defined (PROTOTYPES)
|
---|
33 | # define __P(protos) protos
|
---|
34 | # else
|
---|
35 | # define __P(protos) ()
|
---|
36 | # endif
|
---|
37 | #endif
|
---|
38 |
|
---|
39 | #if defined (HAVE_STRINGIZE)
|
---|
40 | # define __STRING(x) #x
|
---|
41 | #else
|
---|
42 | # define __STRING(x) "x"
|
---|
43 | #endif
|
---|
44 |
|
---|
45 | #if !defined (__STDC__)
|
---|
46 |
|
---|
47 | #if defined (__GNUC__) /* gcc with -traditional */
|
---|
48 | # if !defined (signed)
|
---|
49 | # define signed __signed
|
---|
50 | # endif
|
---|
51 | # if !defined (volatile)
|
---|
52 | # define volatile __volatile
|
---|
53 | # endif
|
---|
54 | #else /* !__GNUC__ */
|
---|
55 | # if !defined (inline)
|
---|
56 | # define inline
|
---|
57 | # endif
|
---|
58 | # if !defined (signed)
|
---|
59 | # define signed
|
---|
60 | # endif
|
---|
61 | # if !defined (volatile)
|
---|
62 | # define volatile
|
---|
63 | # endif
|
---|
64 | #endif /* !__GNUC__ */
|
---|
65 |
|
---|
66 | #endif /* !__STDC__ */
|
---|
67 |
|
---|
68 | #ifndef __attribute__
|
---|
69 | # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
|
---|
70 | # define __attribute__(x)
|
---|
71 | # endif
|
---|
72 | #endif
|
---|
73 |
|
---|
74 | /* For those situations when gcc handles inlining a particular function but
|
---|
75 | other compilers complain. */
|
---|
76 | #ifdef __GNUC__
|
---|
77 | # define INLINE inline
|
---|
78 | #else
|
---|
79 | # define INLINE
|
---|
80 | #endif
|
---|
81 |
|
---|
82 | #if defined (PREFER_STDARG)
|
---|
83 | # define SH_VA_START(va, arg) va_start(va, arg)
|
---|
84 | #else
|
---|
85 | # define SH_VA_START(va, arg) va_start(va)
|
---|
86 | #endif
|
---|
87 |
|
---|
88 | #endif /* !_STDC_H_ */
|
---|