1*e992f068Schristos /* Copyright (C) 2012-2022 Free Software Foundation, Inc. 275fd0b74Schristos 375fd0b74Schristos This program is free software: you can redistribute it and/or modify 475fd0b74Schristos it under the terms of the GNU General Public License as published by 575fd0b74Schristos the Free Software Foundation; either version 3 of the License, or 675fd0b74Schristos (at your option) any later version. 775fd0b74Schristos 875fd0b74Schristos This program is distributed in the hope that it will be useful, 975fd0b74Schristos but WITHOUT ANY WARRANTY; without even the implied warranty of 1075fd0b74Schristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1175fd0b74Schristos GNU General Public License for more details. 1275fd0b74Schristos 1375fd0b74Schristos You should have received a copy of the GNU General Public License 1475fd0b74Schristos along with this program. If not, see <http://www.gnu.org/licenses/>. */ 1575fd0b74Schristos 1675fd0b74Schristos #include "config.h" 1775fd0b74Schristos 1875fd0b74Schristos /* This is a merge of code recommended in the autoconf-2.61 documentation 1975fd0b74Schristos with that recommended in the autoconf-2.13 documentation, with added 2075fd0b74Schristos tweaks to heed C_ALLOCA. */ 2175fd0b74Schristos 2275fd0b74Schristos #if defined HAVE_ALLOCA_H && !defined C_ALLOCA 2375fd0b74Schristos # include <alloca.h> 2475fd0b74Schristos #else 2575fd0b74Schristos # if defined __GNUC__ && !defined C_ALLOCA 2675fd0b74Schristos # if !defined alloca 2775fd0b74Schristos # define alloca __builtin_alloca 2875fd0b74Schristos # endif 2975fd0b74Schristos # else 3075fd0b74Schristos # if defined _AIX 3175fd0b74Schristos /* Indented so that pre-ansi C compilers will ignore it, rather than 3275fd0b74Schristos choke on it. Some versions of AIX require this to be the first 3375fd0b74Schristos thing seen by the compiler except for comments and preprocessor 3475fd0b74Schristos directives. */ 3575fd0b74Schristos #pragma alloca 3675fd0b74Schristos # else 3775fd0b74Schristos # if defined _MSC_VER && !defined C_ALLOCA 3875fd0b74Schristos # include <malloc.h> 3975fd0b74Schristos # define alloca _alloca 4075fd0b74Schristos # else 4175fd0b74Schristos # if !defined alloca 4275fd0b74Schristos # if defined __STDC__ || defined __hpux 4375fd0b74Schristos # if defined HAVE_STDDEF_H 4475fd0b74Schristos # include <stddef.h> 4575fd0b74Schristos # if defined __cplusplus 4675fd0b74Schristos extern "C" void *alloca (size_t); 4775fd0b74Schristos # else 4875fd0b74Schristos extern void *alloca (size_t); 4975fd0b74Schristos # endif 5075fd0b74Schristos # else 5175fd0b74Schristos extern void *alloca (); 5275fd0b74Schristos # endif 5375fd0b74Schristos # else 5475fd0b74Schristos extern char *alloca (); 5575fd0b74Schristos # endif 5675fd0b74Schristos # endif 5775fd0b74Schristos # endif 5875fd0b74Schristos # endif 5975fd0b74Schristos # endif 6075fd0b74Schristos #endif 61