LLVM API Documentation

alloca.h

Go to the documentation of this file.
00001 /*
00002  *                     The LLVM Compiler Infrastructure
00003  *
00004  * This file was developed by the LLVM research group and is distributed under
00005  * the University of Illinois Open Source License. See LICENSE.TXT for details.
00006  *
00007  ******************************************************************************
00008  *
00009  * Description:
00010  *  This header file includes the infamous alloc.h header file if the
00011  *  autoconf system has found it.  It hides all of the autoconf details
00012  *  from the rest of the application source code.
00013  */
00014 
00015 #ifndef _CONFIG_ALLOC_H
00016 #define _CONFIG_ALLOC_H
00017 
00018 #include "llvm/Config/config.h"
00019 
00020 /*
00021  * This is a modified version of that suggested by the Autoconf manual.
00022  *  1) The #pragma is indented so that pre-ANSI C compilers ignore it.
00023  *  2) If alloca.h cannot be found, then try stdlib.h.  Some platforms
00024  *     (notably FreeBSD) defined alloca() there.
00025  */
00026 #ifdef _MSC_VER
00027 #include <malloc.h>
00028 #define alloca _alloca
00029 #elif defined(HAVE_ALLOCA_H)
00030 #include <alloca.h>
00031 #elif defined(__MINGW32__) && defined(HAVE_MALLOC_H)
00032 #include <malloc.h>
00033 #elif !defined(__GNUC__)
00034 # ifdef _AIX
00035 #   pragma alloca
00036 # else
00037 #   ifndef alloca
00038       char * alloca ();
00039 #   endif
00040 # endif
00041 #else
00042 # ifdef HAVE_STDLIB_H
00043 #   include <stdlib.h>
00044 # else
00045 #   error "The function alloca() is required but not found!"
00046 # endif
00047 #endif
00048 
00049 #endif
00050