156a835a5SJohn Marino /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
256a835a5SJohn Marino /* Memory allocation on the stack.
356a835a5SJohn Marino 
4*4ce1b016SDaniel Fojt    Copyright (C) 1995, 1999, 2001-2004, 2006-2020 Free Software Foundation,
556a835a5SJohn Marino    Inc.
656a835a5SJohn Marino 
756a835a5SJohn Marino    This program is free software; you can redistribute it and/or modify it
856a835a5SJohn Marino    under the terms of the GNU General Public License as published
956a835a5SJohn Marino    by the Free Software Foundation; either version 3, or (at your option)
1056a835a5SJohn Marino    any later version.
1156a835a5SJohn Marino 
1256a835a5SJohn Marino    This program is distributed in the hope that it will be useful,
1356a835a5SJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
1456a835a5SJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1556a835a5SJohn Marino    General Public License for more details.
1656a835a5SJohn Marino 
1756a835a5SJohn Marino    You should have received a copy of the GNU General Public
18073c18e4SJohn Marino    License along with this program; if not, see
19*4ce1b016SDaniel Fojt    <https://www.gnu.org/licenses/>.
20073c18e4SJohn Marino   */
2156a835a5SJohn Marino 
2256a835a5SJohn Marino /* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
2356a835a5SJohn Marino    means there is a real alloca function.  */
2456a835a5SJohn Marino #ifndef _GL_ALLOCA_H
2556a835a5SJohn Marino #define _GL_ALLOCA_H
2656a835a5SJohn Marino 
2756a835a5SJohn Marino /* alloca (N) returns a pointer to N bytes of memory
2856a835a5SJohn Marino    allocated on the stack, which will last until the function returns.
2956a835a5SJohn Marino    Use of alloca should be avoided:
3056a835a5SJohn Marino      - inside arguments of function calls - undefined behaviour,
3156a835a5SJohn Marino      - in inline functions - the allocation may actually last until the
3256a835a5SJohn Marino        calling function returns,
3356a835a5SJohn Marino      - for huge N (say, N >= 65536) - you never know how large (or small)
3456a835a5SJohn Marino        the stack is, and when the stack cannot fulfill the memory allocation
3556a835a5SJohn Marino        request, the program just crashes.
3656a835a5SJohn Marino  */
3756a835a5SJohn Marino 
3856a835a5SJohn Marino #ifndef alloca
3956a835a5SJohn Marino # ifdef __GNUC__
40*4ce1b016SDaniel Fojt    /* Some version of mingw have an <alloca.h> that causes trouble when
41*4ce1b016SDaniel Fojt       included after 'alloca' gets defined as a macro.  As a workaround, include
42*4ce1b016SDaniel Fojt       this <alloca.h> first and define 'alloca' as a macro afterwards.  */
43*4ce1b016SDaniel Fojt #  if (defined _WIN32 && ! defined __CYGWIN__) && 1
44*4ce1b016SDaniel Fojt #   include_next <alloca.h>
45*4ce1b016SDaniel Fojt #  endif
4656a835a5SJohn Marino #  define alloca __builtin_alloca
4756a835a5SJohn Marino # elif defined _AIX
4856a835a5SJohn Marino #  define alloca __alloca
4956a835a5SJohn Marino # elif defined _MSC_VER
5056a835a5SJohn Marino #  include <malloc.h>
5156a835a5SJohn Marino #  define alloca _alloca
5256a835a5SJohn Marino # elif defined __DECC && defined __VMS
5356a835a5SJohn Marino #  define alloca __ALLOCA
546aaf5a41SJohn Marino # elif defined __TANDEM && defined _TNS_E_TARGET
556aaf5a41SJohn Marino #  ifdef  __cplusplus
566aaf5a41SJohn Marino extern "C"
576aaf5a41SJohn Marino #  endif
586aaf5a41SJohn Marino void *_alloca (unsigned short);
596aaf5a41SJohn Marino #  pragma intrinsic (_alloca)
606aaf5a41SJohn Marino #  define alloca _alloca
61*4ce1b016SDaniel Fojt # elif defined __MVS__
62*4ce1b016SDaniel Fojt #  include <stdlib.h>
6356a835a5SJohn Marino # else
6456a835a5SJohn Marino #  include <stddef.h>
6556a835a5SJohn Marino #  ifdef  __cplusplus
6656a835a5SJohn Marino extern "C"
6756a835a5SJohn Marino #  endif
6856a835a5SJohn Marino void *alloca (size_t);
6956a835a5SJohn Marino # endif
7056a835a5SJohn Marino #endif
7156a835a5SJohn Marino 
7256a835a5SJohn Marino #endif /* _GL_ALLOCA_H */
73