Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 1 | /* stdc.h -- macros to make source compile on both ANSI C and K&R C compilers. */ |
Jari Aalto | b72432f | 1999-02-19 17:11:39 +0000 | [diff] [blame] | 2 | |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 3 | /* Copyright (C) 1993-2009 Free Software Foundation, Inc. |
Jari Aalto | b72432f | 1999-02-19 17:11:39 +0000 | [diff] [blame] | 4 | |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 5 | This file is part of the GNU Readline Library (Readline), a library |
| 6 | for reading lines of text with interactive input and history editing. |
Jari Aalto | b72432f | 1999-02-19 17:11:39 +0000 | [diff] [blame] | 7 | |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 8 | Readline 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. |
Jari Aalto | b72432f | 1999-02-19 17:11:39 +0000 | [diff] [blame] | 12 | |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 13 | Readline 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. |
Jari Aalto | b72432f | 1999-02-19 17:11:39 +0000 | [diff] [blame] | 17 | |
| 18 | You should have received a copy of the GNU General Public License |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 19 | along with Readline. If not, see <http://www.gnu.org/licenses/>. |
| 20 | */ |
Jari Aalto | b72432f | 1999-02-19 17:11:39 +0000 | [diff] [blame] | 21 | |
Jari Aalto | bb70624 | 2000-03-17 21:46:59 +0000 | [diff] [blame] | 22 | #if !defined (_RL_STDC_H_) |
| 23 | #define _RL_STDC_H_ |
Jari Aalto | b72432f | 1999-02-19 17:11:39 +0000 | [diff] [blame] | 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: |
Jari Aalto | f73dda0 | 2001-11-13 17:56:06 +0000 | [diff] [blame] | 29 | extern char *func PARAMS((char *, char *, int)); */ |
Jari Aalto | b72432f | 1999-02-19 17:11:39 +0000 | [diff] [blame] | 30 | |
Jari Aalto | f73dda0 | 2001-11-13 17:56:06 +0000 | [diff] [blame] | 31 | #if !defined (PARAMS) |
Jari Aalto | bb70624 | 2000-03-17 21:46:59 +0000 | [diff] [blame] | 32 | # if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) |
Jari Aalto | f73dda0 | 2001-11-13 17:56:06 +0000 | [diff] [blame] | 33 | # define PARAMS(protos) protos |
Jari Aalto | bb70624 | 2000-03-17 21:46:59 +0000 | [diff] [blame] | 34 | # else |
Jari Aalto | f73dda0 | 2001-11-13 17:56:06 +0000 | [diff] [blame] | 35 | # define PARAMS(protos) () |
Jari Aalto | b72432f | 1999-02-19 17:11:39 +0000 | [diff] [blame] | 36 | # endif |
Jari Aalto | bb70624 | 2000-03-17 21:46:59 +0000 | [diff] [blame] | 37 | #endif |
Jari Aalto | b72432f | 1999-02-19 17:11:39 +0000 | [diff] [blame] | 38 | |
Jari Aalto | f73dda0 | 2001-11-13 17:56:06 +0000 | [diff] [blame] | 39 | #ifndef __attribute__ |
Jari Aalto | b80f644 | 2004-07-27 13:29:18 +0000 | [diff] [blame] | 40 | # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) |
Jari Aalto | f73dda0 | 2001-11-13 17:56:06 +0000 | [diff] [blame] | 41 | # define __attribute__(x) |
| 42 | # endif |
| 43 | #endif |
Jari Aalto | 28ef6c3 | 2001-04-06 19:14:31 +0000 | [diff] [blame] | 44 | |
Chet Ramey | ac50fba | 2014-02-26 09:36:43 -0500 | [diff] [blame] | 45 | /* Moved from config.h.in because readline.h:rl_message depends on these |
| 46 | defines. */ |
| 47 | #if defined (__STDC__) && defined (HAVE_STDARG_H) |
| 48 | # define PREFER_STDARG |
| 49 | # define USE_VARARGS |
| 50 | #else |
| 51 | # if defined (HAVE_VARARGS_H) |
| 52 | # define PREFER_VARARGS |
| 53 | # define USE_VARARGS |
| 54 | # endif |
| 55 | #endif |
| 56 | |
Jari Aalto | bb70624 | 2000-03-17 21:46:59 +0000 | [diff] [blame] | 57 | #endif /* !_RL_STDC_H_ */ |