Don't attribute in file headers anymore. See llvmdev for the
[oota-llvm.git] / include / llvm / Config / alloca.h
1 /*
2  *                     The LLVM Compiler Infrastructure
3  *
4 // This file is distributed under the University of Illinois Open Source
5 // 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 #include <malloc.h>
28 #define alloca _alloca
29 #elif defined(HAVE_ALLOCA_H)
30 #include <alloca.h>
31 #elif defined(__MINGW32__) && defined(HAVE_MALLOC_H)
32 #include <malloc.h>
33 #elif !defined(__GNUC__)
34 # ifdef _AIX
35 #   pragma alloca
36 # else
37 #   ifndef alloca
38       char * alloca ();
39 #   endif
40 # endif
41 #else
42 # ifdef HAVE_STDLIB_H
43 #   include <stdlib.h>
44 # else
45 #   error "The function alloca() is required but not found!"
46 # endif
47 #endif
48
49 #endif
50