[llvm-commits] CVS: llvm/include/Config/alloca.h

John Criswell criswell at choi.cs.uiuc.edu
Fri Jun 27 14:56:01 PDT 2003


Changes in directory llvm/include/Config:

alloca.h updated: 1.1.2.1 -> 1.1.2.2

---
Log message:

Merged in Brian's suggestion of including stdlib.h if alloca.h does not exist.
This will hopefully fix the build on FreeBSD.


---
Diffs of the changes:

Index: llvm/include/Config/alloca.h
diff -u llvm/include/Config/alloca.h:1.1.2.1 llvm/include/Config/alloca.h:1.1.2.2
--- llvm/include/Config/alloca.h:1.1.2.1	Mon Jun 23 13:45:36 2003
+++ llvm/include/Config/alloca.h	Fri Jun 27 14:55:17 2003
@@ -13,8 +13,10 @@
 #include "Config/config.h"
 
 /*
- * This is the suggested use by the Autoconf manual.
+ * This is a modified form of what is suggested by the Autoconf manual.
  *	1) The #pragma is indented so that pre-ANSI C compilers ignore it.
+ *	2) We attempt to include stdlib.h if we don't find alloca.h since
+ *	   on some systems (notably FreeBSD) alloca() requires stdlib.h.
  */
 #ifndef __GNUC__
 #	ifdef HAVE_ALLOCA_H
@@ -32,7 +34,11 @@
 #	ifdef HAVE_ALLOCA_H
 #		include <alloca.h>
 #	else
-#		error "The function alloca() is required but not found!"
+#		ifdef HAVE_STDLIB_H
+#			include <stdlib.h>
+#		else
+#			error "The function alloca() is required but not found!"
+#		endif
 #	endif
 #endif
 





More information about the llvm-commits mailing list