home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / dev / alst-3.04.lha / ALSt-3.04 / src / _ARGS.h next >
Encoding:
C/C++ Source or Header  |  1994-05-14  |  1.1 KB  |  47 lines

  1. /* Define _ARGS(x) as either x or () depending on an educated guess
  2.    on the presence of support for prototypes in the compiler.
  3.    The idea is that you declare function with prototypes as follows:
  4.        extern char *malloc _ARGS((unsigned int));
  5.    Watch the double parentheses (you'll quickly get used to them).
  6.    Use _ARGS((void)) to declare a function with no arguments.
  7.    Use things like _ARGS((char *, ...)) to declare printf-like functions.
  8.    
  9.    As a free extra, the macro HAVE_PROTOTYPES is defined if and only if
  10.    prototypes are supported, and the macro 'const' is defined as empty
  11.    if prototypes are not supported (and also if THINK_C is defined).
  12. */
  13.  
  14. #ifndef _ARGS
  15.  
  16. #ifdef __STDC__
  17. #define HAVE_PROTOTYPES
  18. #endif
  19.  
  20. #ifdef THINK_C
  21. #undef HAVE_PROTOTYPES
  22. #define HAVE_PROTOTYPES
  23. #endif
  24.  
  25. #ifdef sgi
  26. #ifdef mips
  27. #define HAVE_PROTOTYPES
  28. #endif
  29. #endif
  30.  
  31. #ifdef HAVE_PROTOTYPES
  32. #define _ARGS(x) x
  33. #else
  34. #define _ARGS(x) ()
  35. #endif
  36.  
  37. #ifndef HAVE_PROTOTYPES
  38. #define const /*empty*/
  39. #else /* HAVE_PROTOTYPES */
  40. #ifdef THINK_C
  41. #undef const
  42. #define const /*empty*/
  43. #endif /* THINK_C */
  44. #endif /* HAVE_PROTOTYPES */
  45.  
  46. #endif /* _ARGS */
  47.