<alloca.h> on cygwin pulls in a ton of stuff (macros and function protos)
[oota-llvm.git] / lib / Target / CBackend / Writer.cpp
index b73a4e40cd852181704cb38df1eae02cd661e1d3..d993919f8b1064d2aea82a70105f921ec4e743c4 100644 (file)
@@ -660,7 +660,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"
-      << "#ifdef sun\n"
+      << "#if defined(sun) || defined(__CYGWIN__)\n"
       << "extern void *__builtin_alloca(unsigned long);\n"
       << "#define alloca(x) __builtin_alloca(x)\n"
       << "#else\n"