home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 5.ddi / MWHC.005 / L4 < prev    next >
Encoding:
Text File  |  1992-12-09  |  976 b   |  41 lines

  1. /*
  2.  *   alloca.h -- non-ANSI 
  3.  *
  4.  *   This file MUST be included for "alloca(n)" to work.
  5.  *
  6.  *           Copyright (c) 1991, MetaWare Incorporated
  7.  */
  8.  
  9. #ifndef _ALLOCA_H
  10. #define _ALLOCA_H
  11.  
  12. #ifdef __CPLUSPLUS__
  13. extern "C" {
  14. #endif
  15.  
  16. /*
  17.  * NOTE:
  18.  * alloca(n) is not an ANSI-defined library function.
  19.  * Nevertheless, on many architectures, it cannot be supported unless the
  20.  * compiler is able to generate inline code for it.
  21.  * Therefore, we define the special macro "_ALLOC", which tells the compiler
  22.  * to "recognize" alloca as a builtin, in the same manner as memcpy and
  23.  * abs() are recognized.
  24.  *
  25.  * However, this only works for those front-ends built since May 7, 1991.
  26.  */
  27. #ifndef _ALLOCA
  28. #    define _ALLOCA _ALLOCA
  29. #endif
  30.  
  31. #if defined _ALLOCA || !defined __HIGHC__ 
  32.     extern void *alloca(unsigned n);
  33. #else
  34. #   define alloca(n) _Alloca(n)        /* Old way of doing it. */
  35. #endif
  36.  
  37. #ifdef __CPLUSPLUS__
  38. }
  39. #endif
  40. #endif /*_ALLOCA_H*/
  41.