The alloca function, strangely enough, is found in the malloc.h header file
[oota-llvm.git] / include / llvm / Config / alloca.h
1 /*
2  *                     The LLVM Compiler Infrastructure
3  *
4  * This file was developed by the LLVM research group and is distributed under
5  * the University of Illinois Open Source License. See LICENSE.TXT for details.
6  * 
7  ******************************************************************************
8  *
9  * Description:
10  *      This header file includes the infamous alloc.h header file if the
11  *      autoconf system has found it.  It hides all of the autoconf details
12  *      from the rest of the application source code.
13  */
14
15 #ifndef _CONFIG_ALLOC_H
16 #define _CONFIG_ALLOC_H
17
18 #include "llvm/Config/config.h"
19
20 /*
21  * This is a modified version of that suggested by the Autoconf manual.
22  *      1) The #pragma is indented so that pre-ANSI C compilers ignore it.
23  *      2) If alloca.h cannot be found, then try stdlib.h.  Some platforms
24  *         (notably FreeBSD) defined alloca() there.
25  */
26 #ifdef _MSC_VER
27 /* noop on Visual C++ */
28 #elif defined(HAVE_ALLOCA_H)
29 #include <alloca.h>
30 #elif defined(__MINGW_H) && defined(HAVE_MALLOC_H)
31 #include <malloc.h>
32 #elif !defined(__GNUC__)
33 #       ifdef _AIX
34  #              pragma alloca
35 #       else
36 #               ifndef alloca
37                         char * alloca ();
38 #               endif
39 #       endif
40 #else
41 #       ifdef HAVE_STDLIB_H
42 #               include <stdlib.h>
43 #       else
44 #               error "The function alloca() is required but not found!"
45 #       endif
46 #endif
47
48 #endif
49