rlstdc.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* stdc.h -- macros to make source compile on both ANSI C and K&R C compilers. */
  2. /* Copyright (C) 1993-2009 Free Software Foundation, Inc.
  3. This file is part of the GNU Readline Library (Readline), a library
  4. for reading lines of text with interactive input and history editing.
  5. Readline is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. Readline 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
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with Readline. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #if !defined (_RL_STDC_H_)
  17. #define _RL_STDC_H_
  18. /* Adapted from BSD /usr/include/sys/cdefs.h. */
  19. /* A function can be defined using prototypes and compile on both ANSI C
  20. and traditional C compilers with something like this:
  21. extern char *func PARAMS((char *, char *, int)); */
  22. #if !defined (PARAMS)
  23. # if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus)
  24. # define PARAMS(protos) protos
  25. # else
  26. # define PARAMS(protos) ()
  27. # endif
  28. #endif
  29. #ifndef __attribute__
  30. # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
  31. # define __attribute__(x)
  32. # endif
  33. #endif
  34. /* Moved from config.h.in because readline.h:rl_message depends on these
  35. defines. */
  36. #if defined (__STDC__) && defined (HAVE_STDARG_H)
  37. # define PREFER_STDARG
  38. # define USE_VARARGS
  39. #else
  40. # if defined (HAVE_VARARGS_H)
  41. # define PREFER_VARARGS
  42. # define USE_VARARGS
  43. # endif
  44. #endif
  45. #endif /* !_RL_STDC_H_ */