Blame gl/alloca.in.h

Packit a4aae4
/* Memory allocation on the stack.
Packit a4aae4
Packit a4aae4
   Copyright (C) 1995, 1999, 2001-2004, 2006-2017 Free Software Foundation,
Packit a4aae4
   Inc.
Packit a4aae4
Packit a4aae4
   This program is free software; you can redistribute it and/or modify it
Packit a4aae4
   under the terms of the GNU Lesser General Public License as published
Packit a4aae4
   by the Free Software Foundation; either version 2, or (at your option)
Packit a4aae4
   any later version.
Packit a4aae4
Packit a4aae4
   This program is distributed in the hope that it will be useful,
Packit a4aae4
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit a4aae4
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit a4aae4
   Lesser General Public License for more details.
Packit a4aae4
Packit a4aae4
   You should have received a copy of the GNU Lesser General Public
Packit a4aae4
   License along with this program; if not, see
Packit a4aae4
   <http://www.gnu.org/licenses/>.
Packit a4aae4
  */
Packit a4aae4
Packit a4aae4
/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
Packit a4aae4
   means there is a real alloca function.  */
Packit a4aae4
#ifndef _GL_ALLOCA_H
Packit a4aae4
#define _GL_ALLOCA_H
Packit a4aae4
Packit a4aae4
/* alloca (N) returns a pointer to N bytes of memory
Packit a4aae4
   allocated on the stack, which will last until the function returns.
Packit a4aae4
   Use of alloca should be avoided:
Packit a4aae4
     - inside arguments of function calls - undefined behaviour,
Packit a4aae4
     - in inline functions - the allocation may actually last until the
Packit a4aae4
       calling function returns,
Packit a4aae4
     - for huge N (say, N >= 65536) - you never know how large (or small)
Packit a4aae4
       the stack is, and when the stack cannot fulfill the memory allocation
Packit a4aae4
       request, the program just crashes.
Packit a4aae4
 */
Packit a4aae4
Packit a4aae4
#ifndef alloca
Packit a4aae4
# ifdef __GNUC__
Packit a4aae4
#  define alloca __builtin_alloca
Packit a4aae4
# elif defined _AIX
Packit a4aae4
#  define alloca __alloca
Packit a4aae4
# elif defined _MSC_VER
Packit a4aae4
#  include <malloc.h>
Packit a4aae4
#  define alloca _alloca
Packit a4aae4
# elif defined __DECC && defined __VMS
Packit a4aae4
#  define alloca __ALLOCA
Packit a4aae4
# elif defined __TANDEM && defined _TNS_E_TARGET
Packit a4aae4
#  ifdef  __cplusplus
Packit a4aae4
extern "C"
Packit a4aae4
#  endif
Packit a4aae4
void *_alloca (unsigned short);
Packit a4aae4
#  pragma intrinsic (_alloca)
Packit a4aae4
#  define alloca _alloca
Packit a4aae4
# elif defined __MVS__
Packit a4aae4
#  include <stdlib.h>
Packit a4aae4
# else
Packit a4aae4
#  include <stddef.h>
Packit a4aae4
#  ifdef  __cplusplus
Packit a4aae4
extern "C"
Packit a4aae4
#  endif
Packit a4aae4
void *alloca (size_t);
Packit a4aae4
# endif
Packit a4aae4
#endif
Packit a4aae4
Packit a4aae4
#endif /* _GL_ALLOCA_H */