Include alloca.h only, if HAVE_ALLOCA_H is set.
authorChristoph Mallon <christoph.mallon@gmx.de>
Fri, 28 Nov 2008 14:54:23 +0000 (14:54 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Fri, 28 Nov 2008 14:54:23 +0000 (14:54 +0000)
[r24121]

configure.ac
include/libfirm/adt/xmalloc.h
ir/libcore/lc_opts.c
ir/libcore/lc_opts_enum.c

index 25de1b4..b9a90e1 100644 (file)
@@ -119,6 +119,7 @@ dnl ========================
 
 AC_HEADER_STDC
 AC_CHECK_HEADERS([math.h], , AC_MSG_ERROR("math header file not found"))
+AC_CHECK_HEADERS([alloca.h])
 
 dnl Checks for libraries.
 dnl =====================
index 6e0283c..0d292ca 100644 (file)
@@ -95,7 +95,8 @@ char *xstrdup(const char *str);
 #include <stdlib.h>
 #elif defined(_WIN32)
 #include <malloc.h>
-#else
+#endif
+#ifdef HAVE_ALLOCA_H
 #include <alloca.h>
 #endif
 
index f9b84b7..f55f5e3 100644 (file)
@@ -27,7 +27,8 @@
 #include <stdlib.h>
 #elif defined(_WIN32)
 #include <malloc.h>
-#else
+#endif
+#ifdef HAVE_ALLOCA_H
 #include <alloca.h>
 #endif
 
index 1d67602..cb66e54 100644 (file)
@@ -19,7 +19,8 @@
 #include <stdlib.h>
 #elif defined(_WIN32)
 #include <malloc.h>
-#else
+#endif
+#ifdef HAVE_ALLOCA_H
 #include <alloca.h>
 #endif