11541Srgrimes/* Copyright (C) 2012-2020 Free Software Foundation, Inc.
21541Srgrimes
31541Srgrimes   This program is free software: you can redistribute it and/or modify
41541Srgrimes   it under the terms of the GNU General Public License as published by
51541Srgrimes   the Free Software Foundation; either version 3 of the License, or
61541Srgrimes   (at your option) any later version.
71541Srgrimes
81541Srgrimes   This program is distributed in the hope that it will be useful,
91541Srgrimes   but WITHOUT ANY WARRANTY; without even the implied warranty of
101541Srgrimes   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
111541Srgrimes   GNU General Public License for more details.
121541Srgrimes
131541Srgrimes   You should have received a copy of the GNU General Public License
141541Srgrimes   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
151541Srgrimes
161541Srgrimes#include "config.h"
171541Srgrimes
181541Srgrimes/* This is a merge of code recommended in the autoconf-2.61 documentation
191541Srgrimes   with that recommended in the autoconf-2.13 documentation, with added
201541Srgrimes   tweaks to heed C_ALLOCA.  */
211541Srgrimes
221541Srgrimes#if defined HAVE_ALLOCA_H && !defined C_ALLOCA
231541Srgrimes# include <alloca.h>
241541Srgrimes#else
251541Srgrimes# if defined __GNUC__ && !defined C_ALLOCA
261541Srgrimes#  if !defined alloca
271541Srgrimes#   define alloca __builtin_alloca
281541Srgrimes#  endif
291541Srgrimes# else
301541Srgrimes#  if defined _AIX
311541Srgrimes/* Indented so that pre-ansi C compilers will ignore it, rather than
321541Srgrimes   choke on it.  Some versions of AIX require this to be the first
331541Srgrimes   thing seen by the compiler except for comments and preprocessor
344104Swollman   directives.  */
351541Srgrimes    #pragma alloca
361541Srgrimes#  else
372168Spaul#   if defined _MSC_VER && !defined C_ALLOCA
382168Spaul#    include <malloc.h>
392168Spaul#    define alloca _alloca
401541Srgrimes#   else
411541Srgrimes#    if !defined alloca
421541Srgrimes#     if defined __STDC__ || defined __hpux
431541Srgrimes#      if defined HAVE_STDDEF_H
441541Srgrimes#       include <stddef.h>
451541Srgrimes#       if defined  __cplusplus
461541Srgrimesextern "C" void *alloca (size_t);
471541Srgrimes#       else
481541Srgrimesextern void *alloca (size_t);
491541Srgrimes#       endif
501541Srgrimes#      else
511541Srgrimesextern void *alloca ();
521541Srgrimes#      endif
531541Srgrimes#     else
541541Srgrimesextern char *alloca ();
551541Srgrimes#     endif
561541Srgrimes#    endif
571541Srgrimes#   endif
581541Srgrimes#  endif
591541Srgrimes# endif
601541Srgrimes#endif
611541Srgrimes