1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

Fix alloca support for Cygwin. On cygwin its __alloca not __builtin_alloca

llvm-svn: 19776
This commit is contained in:
Reid Spencer 2005-01-23 04:32:47 +00:00
parent 5c7b6e83f0
commit e48557f583

View File

@ -723,7 +723,10 @@ void CWriter::writeOperand(Value *Operand) {
static void generateCompilerSpecificCode(std::ostream& Out) { static void generateCompilerSpecificCode(std::ostream& Out) {
// Alloca is hard to get, and we don't want to include stdlib.h here... // Alloca is hard to get, and we don't want to include stdlib.h here...
Out << "/* get a declaration for alloca */\n" Out << "/* get a declaration for alloca */\n"
<< "#if defined(__CYGWIN__) || defined(__APPLE__)\n" << "#if defined(__CYGWIN__)\n"
<< "extern void *_alloca(unsigned long);\n"
<< "#define alloca(x) _alloca(x)\n"
<< "#elif defined(__APPLE__)\n"
<< "extern void *__builtin_alloca(unsigned long);\n" << "extern void *__builtin_alloca(unsigned long);\n"
<< "#define alloca(x) __builtin_alloca(x)\n" << "#define alloca(x) __builtin_alloca(x)\n"
<< "#elif defined(__sun__)\n" << "#elif defined(__sun__)\n"