f27ef060dcb5113e2dddfe3562fcec3eb50fd863
[oota-llvm.git] / include / Config / alloca.h
1 /*
2  * Header file: alloc.h
3  *
4  * Description:
5  *      This header file includes the infamous alloc.h header file if the
6  *      autoconf system has found it.  It hides all of the autoconf details
7  *      from the rest of the application source code.
8  */
9
10 #ifndef _CONFIG_ALLOC_H
11 #define _CONFIG_ALLOC_H
12
13 #include "Config/config.h"
14
15 /*
16  * This is a modified version of that suggested by the Autoconf manual.
17  *      1) The #pragma is indented so that pre-ANSI C compilers ignore it.
18  *      2) If alloca.h cannot be found, then try stdlib.h.  Some platforms
19  *         (notably FreeBSD) defined alloca() there.
20  */
21 #ifndef __GNUC__
22 #       ifdef HAVE_ALLOCA_H
23 #               include <alloca.h>
24 #       else
25 #               ifdef _AIX
26  #                      pragma alloca
27 #               else
28 #                       ifndef alloca
29                                 char * alloca ();
30 #                       endif
31 #               endif
32 #       endif
33 #else
34 #       ifdef HAVE_ALLOCA_H
35 #               include <alloca.h>
36 #       else
37 #               ifdef HAVE_STDLIB_H
38 #                       include <stdlib.h>
39 #               else
40 #                       error "The function alloca() is required but not found!"
41 #               endif
42 #       endif
43 #endif
44
45 #endif
46