]>
git.ipfire.org Git - thirdparty/bash.git/blob - memalloc.h
1 /* memalloc.h -- consolidate code for including alloca.h or malloc.h and
4 /* Copyright (C) 1993 Free Software Foundation, Inc.
6 This file is part of GNU Bash, the Bourne Again SHell.
8 Bash is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2, or (at your option) any later
13 Bash is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License along
19 with Bash; see the file COPYING. If not, write to the Free Software
20 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
22 #if !defined (_MEMALLOC_H_)
25 #if defined (sparc) && defined (sun) && !defined (HAVE_ALLOCA_H)
26 # define HAVE_ALLOCA_H
29 #if defined (__GNUC__) && !defined (HAVE_ALLOCA)
33 #if defined (HAVE_ALLOCA_H) && !defined (HAVE_ALLOCA)
35 #endif /* HAVE_ALLOCA_H && !HAVE_ALLOCA */
37 #if defined (__GNUC__)
39 # define alloca __builtin_alloca
41 # if defined (HAVE_ALLOCA_H)
47 # else /* !HAVE_ALLOCA_H */
48 # if defined (__hpux) && defined (__STDC__) && !defined (alloca)
49 extern void *alloca ();
51 # if !defined (alloca)
52 extern char *alloca ();
54 # endif /* !__hpux || !__STDC__ && !alloca */
55 # endif /* !HAVE_ALLOCA_H */
56 #endif /* !__GNUC__ */
58 #endif /* _MEMALLOC_H_ */