From fa6e71e31d5c1a3a1cf21d885cdd5c330b8a35be Mon Sep 17 00:00:00 2001 From: Nick Hildenbrandt Date: Fri, 11 Oct 2002 21:40:44 +0000 Subject: [PATCH] Instead of adding stdlib we just prototype malloc correctly. llvm-svn: 4118 --- llvm/lib/CWriter/Writer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/lib/CWriter/Writer.cpp b/llvm/lib/CWriter/Writer.cpp index 2c6d855ae772..4765f409e201 100644 --- a/llvm/lib/CWriter/Writer.cpp +++ b/llvm/lib/CWriter/Writer.cpp @@ -514,7 +514,7 @@ void CWriter::printModule(Module *M) { } // printing stdlib inclusion - Out << "#include \n"; + //Out << "#include \n"; // get declaration for alloca Out << "/* Provide Declarations */\n" @@ -541,6 +541,8 @@ void CWriter::printModule(Module *M) { // Global variable declarations... if (!M->gempty()) { Out << "\n/* External Global Variable Declarations */\n"; + // Needed for malloc to work on sun. + Out << "extern void * malloc(size_t);\n"; for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I) { if (I->hasExternalLinkage()) { Out << "extern ";