blob: 2aaa30babfbdd7e86eed5062b7324e819d5f68e8 [file] [log] [blame]
Jari Aalto31859422009-01-12 13:36:28 +00001/* stdc.h -- macros to make source compile on both ANSI C and K&R C compilers. */
Jari Aaltob72432f1999-02-19 17:11:39 +00002
Jari Aalto31859422009-01-12 13:36:28 +00003/* Copyright (C) 1993-2009 Free Software Foundation, Inc.
Jari Aaltob72432f1999-02-19 17:11:39 +00004
Jari Aalto31859422009-01-12 13:36:28 +00005 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 Aaltob72432f1999-02-19 17:11:39 +00007
Jari Aalto31859422009-01-12 13:36:28 +00008 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 Aaltob72432f1999-02-19 17:11:39 +000012
Jari Aalto31859422009-01-12 13:36:28 +000013 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 Aaltob72432f1999-02-19 17:11:39 +000017
18 You should have received a copy of the GNU General Public License
Jari Aalto31859422009-01-12 13:36:28 +000019 along with Readline. If not, see <http://www.gnu.org/licenses/>.
20*/
Jari Aaltob72432f1999-02-19 17:11:39 +000021
Jari Aaltobb706242000-03-17 21:46:59 +000022#if !defined (_RL_STDC_H_)
23#define _RL_STDC_H_
Jari Aaltob72432f1999-02-19 17:11:39 +000024
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 Aaltof73dda02001-11-13 17:56:06 +000029 extern char *func PARAMS((char *, char *, int)); */
Jari Aaltob72432f1999-02-19 17:11:39 +000030
Jari Aaltof73dda02001-11-13 17:56:06 +000031#if !defined (PARAMS)
Jari Aaltobb706242000-03-17 21:46:59 +000032# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus)
Jari Aaltof73dda02001-11-13 17:56:06 +000033# define PARAMS(protos) protos
Jari Aaltobb706242000-03-17 21:46:59 +000034# else
Jari Aaltof73dda02001-11-13 17:56:06 +000035# define PARAMS(protos) ()
Jari Aaltob72432f1999-02-19 17:11:39 +000036# endif
Jari Aaltobb706242000-03-17 21:46:59 +000037#endif
Jari Aaltob72432f1999-02-19 17:11:39 +000038
Jari Aaltof73dda02001-11-13 17:56:06 +000039#ifndef __attribute__
Jari Aaltob80f6442004-07-27 13:29:18 +000040# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
Jari Aaltof73dda02001-11-13 17:56:06 +000041# define __attribute__(x)
42# endif
43#endif
Jari Aalto28ef6c32001-04-06 19:14:31 +000044
Chet Rameyac50fba2014-02-26 09:36:43 -050045/* 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 Aaltobb706242000-03-17 21:46:59 +000057#endif /* !_RL_STDC_H_ */