From: Chris Lattner Date: Fri, 2 Jun 2006 18:54:01 +0000 (+0000) Subject: Add mingw support, patch contributed by Anton X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d9477607dc44ca92c6fde88706c219c21fddc96b;p=oota-llvm.git Add mingw support, patch contributed by Anton git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28661 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 6786780d23e..36336b38d58 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -833,7 +833,7 @@ void CWriter::writeOperand(Value *Operand) { static void generateCompilerSpecificCode(std::ostream& Out) { // Alloca is hard to get, and we don't want to include stdlib.h here. Out << "/* get a declaration for alloca */\n" - << "#if defined(__CYGWIN__)\n" + << "#if defined(__CYGWIN__) || defined(__MINGW32__)\n" << "extern void *_alloca(unsigned long);\n" << "#define alloca(x) _alloca(x)\n" << "#elif defined(__APPLE__)\n" diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index 6786780d23e..36336b38d58 100644 --- a/lib/Target/CBackend/Writer.cpp +++ b/lib/Target/CBackend/Writer.cpp @@ -833,7 +833,7 @@ void CWriter::writeOperand(Value *Operand) { static void generateCompilerSpecificCode(std::ostream& Out) { // Alloca is hard to get, and we don't want to include stdlib.h here. Out << "/* get a declaration for alloca */\n" - << "#if defined(__CYGWIN__)\n" + << "#if defined(__CYGWIN__) || defined(__MINGW32__)\n" << "extern void *_alloca(unsigned long);\n" << "#define alloca(x) _alloca(x)\n" << "#elif defined(__APPLE__)\n"