1*a9fa9459Szrj /* Copyright (C) 2012-2016 Free Software Foundation, Inc. 2*a9fa9459Szrj 3*a9fa9459Szrj This program is free software: you can redistribute it and/or modify 4*a9fa9459Szrj it under the terms of the GNU General Public License as published by 5*a9fa9459Szrj the Free Software Foundation; either version 3 of the License, or 6*a9fa9459Szrj (at your option) any later version. 7*a9fa9459Szrj 8*a9fa9459Szrj This program is distributed in the hope that it will be useful, 9*a9fa9459Szrj but WITHOUT ANY WARRANTY; without even the implied warranty of 10*a9fa9459Szrj MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11*a9fa9459Szrj GNU General Public License for more details. 12*a9fa9459Szrj 13*a9fa9459Szrj You should have received a copy of the GNU General Public License 14*a9fa9459Szrj along with this program. If not, see <http://www.gnu.org/licenses/>. */ 15*a9fa9459Szrj 16*a9fa9459Szrj #include "config.h" 17*a9fa9459Szrj 18*a9fa9459Szrj /* This is a merge of code recommended in the autoconf-2.61 documentation 19*a9fa9459Szrj with that recommended in the autoconf-2.13 documentation, with added 20*a9fa9459Szrj tweaks to heed C_ALLOCA. */ 21*a9fa9459Szrj 22*a9fa9459Szrj #if defined HAVE_ALLOCA_H && !defined C_ALLOCA 23*a9fa9459Szrj # include <alloca.h> 24*a9fa9459Szrj #else 25*a9fa9459Szrj # if defined __GNUC__ && !defined C_ALLOCA 26*a9fa9459Szrj # if !defined alloca 27*a9fa9459Szrj # define alloca __builtin_alloca 28*a9fa9459Szrj # endif 29*a9fa9459Szrj # else 30*a9fa9459Szrj # if defined _AIX 31*a9fa9459Szrj /* Indented so that pre-ansi C compilers will ignore it, rather than 32*a9fa9459Szrj choke on it. Some versions of AIX require this to be the first 33*a9fa9459Szrj thing seen by the compiler except for comments and preprocessor 34*a9fa9459Szrj directives. */ 35*a9fa9459Szrj #pragma alloca 36*a9fa9459Szrj # else 37*a9fa9459Szrj # if defined _MSC_VER && !defined C_ALLOCA 38*a9fa9459Szrj # include <malloc.h> 39*a9fa9459Szrj # define alloca _alloca 40*a9fa9459Szrj # else 41*a9fa9459Szrj # if !defined alloca 42*a9fa9459Szrj # if defined __STDC__ || defined __hpux 43*a9fa9459Szrj # if defined HAVE_STDDEF_H 44*a9fa9459Szrj # include <stddef.h> 45*a9fa9459Szrj # if defined __cplusplus 46*a9fa9459Szrj extern "C" void *alloca (size_t); 47*a9fa9459Szrj # else 48*a9fa9459Szrj extern void *alloca (size_t); 49*a9fa9459Szrj # endif 50*a9fa9459Szrj # else 51*a9fa9459Szrj extern void *alloca (); 52*a9fa9459Szrj # endif 53*a9fa9459Szrj # else 54*a9fa9459Szrj extern char *alloca (); 55*a9fa9459Szrj # endif 56*a9fa9459Szrj # endif 57*a9fa9459Szrj # endif 58*a9fa9459Szrj # endif 59*a9fa9459Szrj # endif 60*a9fa9459Szrj #endif 61