Blame gl/alloca.in.h

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