1 /* stdc.h -- macros to make source compile on both ANSI C and K&R C
4 /* Copyright (C) 1993 Free Software Foundation, Inc.
6 This file is part of GNU Bash, the Bourne Again SHell.
8 Bash is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 Bash is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with Bash. If not, see <http://www.gnu.org/licenses/>.
22 #if !defined (_STDC_H_)
25 /* Adapted from BSD /usr/include/sys/cdefs.h. */
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)); */
32 # if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) || defined (PROTOTYPES)
33 # define __P(protos) protos
35 # define __P(protos) ()
39 #if defined (HAVE_STRINGIZE)
40 # define __STRING(x) #x
42 # define __STRING(x) "x"
45 #if !defined (__STDC__)
47 #if defined (__GNUC__) /* gcc with -traditional */
48 # if !defined (signed)
49 # define signed __signed
51 # if !defined (volatile)
52 # define volatile __volatile
55 # if !defined (inline)
58 # if !defined (signed)
61 # if !defined (volatile)
64 #endif /* !__GNUC__ */
66 #endif /* !__STDC__ */
69 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
70 # define __attribute__(x)
74 /* For those situations when gcc handles inlining a particular function but
75 other compilers complain. */
77 # define INLINE inline
82 #if defined (PREFER_STDARG)
83 # define SH_VA_START(va, arg) va_start(va, arg)
85 # define SH_VA_START(va, arg) va_start(va)
88 #endif /* !_STDC_H_ */