alloca.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
  2. /* Memory allocation on the stack.
  3. Copyright (C) 1995, 1999, 2001-2004, 2006-2013 Free Software Foundation,
  4. Inc.
  5. This program is free software; you can redistribute it and/or modify it
  6. under the terms of the GNU General Public License as published
  7. by the Free Software Foundation; either version 3, or (at your option)
  8. any later version.
  9. This program 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 GNU
  12. General Public License for more details.
  13. You should have received a copy of the GNU General Public
  14. License along with this program; if not, see
  15. <http://www.gnu.org/licenses/>.
  16. */
  17. /* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
  18. means there is a real alloca function. */
  19. #ifndef _GL_ALLOCA_H
  20. #define _GL_ALLOCA_H
  21. /* alloca (N) returns a pointer to N bytes of memory
  22. allocated on the stack, which will last until the function returns.
  23. Use of alloca should be avoided:
  24. - inside arguments of function calls - undefined behaviour,
  25. - in inline functions - the allocation may actually last until the
  26. calling function returns,
  27. - for huge N (say, N >= 65536) - you never know how large (or small)
  28. the stack is, and when the stack cannot fulfill the memory allocation
  29. request, the program just crashes.
  30. */
  31. #ifndef alloca
  32. # ifdef __GNUC__
  33. # define alloca __builtin_alloca
  34. # elif defined _AIX
  35. # define alloca __alloca
  36. # elif defined _MSC_VER
  37. # include <malloc.h>
  38. # define alloca _alloca
  39. # elif defined __DECC && defined __VMS
  40. # define alloca __ALLOCA
  41. # elif defined __TANDEM && defined _TNS_E_TARGET
  42. # ifdef __cplusplus
  43. extern "C"
  44. # endif
  45. void *_alloca (unsigned short);
  46. # pragma intrinsic (_alloca)
  47. # define alloca _alloca
  48. # else
  49. # include <stddef.h>
  50. # ifdef __cplusplus
  51. extern "C"
  52. # endif
  53. void *alloca (size_t);
  54. # endif
  55. #endif
  56. #endif /* _GL_ALLOCA_H */