Blame gl/alloca.in.h

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