summaryrefslogtreecommitdiffstats
path: root/Source/cmCreateTestSourceList.cxx
diff options
context:
space:
mode:
authorSebastien Barre <sebastien.barre@kitware.com>2002-07-30 14:33:02 (GMT)
committerSebastien Barre <sebastien.barre@kitware.com>2002-07-30 14:33:02 (GMT)
commitc05e3613ce61c0a330df7102b9660ec9da37bf3d (patch)
treee97775e3bb9b68cfb1f238a26060bf4378058154 /Source/cmCreateTestSourceList.cxx
parentf87057813da84451aa60e85d3992b89e1f3c7bb0 (diff)
downloadCMake-c05e3613ce61c0a330df7102b9660ec9da37bf3d.zip
CMake-c05e3613ce61c0a330df7102b9660ec9da37bf3d.tar.gz
CMake-c05e3613ce61c0a330df7102b9660ec9da37bf3d.tar.bz2
FIX: la commande créait du code C++. Du code C devrait faire l'affaire.
Diffstat (limited to 'Source/cmCreateTestSourceList.cxx')
-rw-r--r--Source/cmCreateTestSourceList.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx
index 74279fe..9df7a25 100644
--- a/Source/cmCreateTestSourceList.cxx
+++ b/Source/cmCreateTestSourceList.cxx
@@ -91,7 +91,8 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn)
fout <<
"#include <ctype.h>\n"
"#include <stdio.h>\n"
- "#include <string.h>\n";
+ "#include <string.h>\n"
+ "#include <malloc.h>\n";
if(extraInclude.size())
{
fout << "#include \"" << extraInclude << "\"\n";
@@ -156,11 +157,12 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn)
"};\n"
"\n"
"// Allocate and create a lowercased copy of string\n"
+ "// (note that it has to be free'd manually)\n"
"\n"
"char* lowercase(const char *string)\n"
"{\n"
" char *new_string, *p;\n"
- " new_string = new char[strlen(string) + 1];\n"
+ " new_string = (char *)malloc(sizeof(char) * (size_t)(strlen(string) + 1));\n"
" if (!new_string)\n"
" {\n"
" return NULL;\n"
@@ -235,9 +237,9 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn)
" {\n"
" return (*cmakeGeneratedFunctionMapEntries[i].func)(ac - 1, av + 1);\n"
" }\n"
- " delete [] test_name;\n"
+ " free(test_name);\n"
" }\n"
- " delete [] arg;\n"
+ " free(arg);\n"
" \n"
" // If the test was not found but there is only one test, then\n"
" // run it with the arguments\n"