FIX: la commande créait du code C++. Du code C devrait faire l'affaire.
This commit is contained in:
parent
f87057813d
commit
c05e3613ce
@ -91,7 +91,8 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn)
|
|||||||
fout <<
|
fout <<
|
||||||
"#include <ctype.h>\n"
|
"#include <ctype.h>\n"
|
||||||
"#include <stdio.h>\n"
|
"#include <stdio.h>\n"
|
||||||
"#include <string.h>\n";
|
"#include <string.h>\n"
|
||||||
|
"#include <malloc.h>\n";
|
||||||
if(extraInclude.size())
|
if(extraInclude.size())
|
||||||
{
|
{
|
||||||
fout << "#include \"" << extraInclude << "\"\n";
|
fout << "#include \"" << extraInclude << "\"\n";
|
||||||
@ -156,11 +157,12 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn)
|
|||||||
"};\n"
|
"};\n"
|
||||||
"\n"
|
"\n"
|
||||||
"// Allocate and create a lowercased copy of string\n"
|
"// Allocate and create a lowercased copy of string\n"
|
||||||
|
"// (note that it has to be free'd manually)\n"
|
||||||
"\n"
|
"\n"
|
||||||
"char* lowercase(const char *string)\n"
|
"char* lowercase(const char *string)\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" char *new_string, *p;\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"
|
" if (!new_string)\n"
|
||||||
" {\n"
|
" {\n"
|
||||||
" return NULL;\n"
|
" return NULL;\n"
|
||||||
@ -235,9 +237,9 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn)
|
|||||||
" {\n"
|
" {\n"
|
||||||
" return (*cmakeGeneratedFunctionMapEntries[i].func)(ac - 1, av + 1);\n"
|
" return (*cmakeGeneratedFunctionMapEntries[i].func)(ac - 1, av + 1);\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
" delete [] test_name;\n"
|
" free(test_name);\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
" delete [] arg;\n"
|
" free(arg);\n"
|
||||||
" \n"
|
" \n"
|
||||||
" // If the test was not found but there is only one test, then\n"
|
" // If the test was not found but there is only one test, then\n"
|
||||||
" // run it with the arguments\n"
|
" // run it with the arguments\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user