Changes For Bug 352
[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(__GNUC__)
31 #       ifdef _AIX
32  #              pragma alloca
33 #       else
34 #               ifndef alloca
35                         char * alloca ();
36 #               endif
37 #       endif
38 #else
39 #       ifdef HAVE_STDLIB_H
40 #               include <stdlib.h>
41 #       else
42 #               error "The function alloca() is required but not found!"
43 #       endif
44 #endif
45
46 #endif
47