OSDN Git Service

Add mingw support, patch contributed by Anton
authorChris Lattner <sabre@nondot.org>
Fri, 2 Jun 2006 18:54:01 +0000 (18:54 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 2 Jun 2006 18:54:01 +0000 (18:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28661 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CBackend/CBackend.cpp
lib/Target/CBackend/Writer.cpp

index 6786780..36336b3 100644 (file)
@@ -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"
index 6786780..36336b3 100644 (file)
@@ -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"