* patch by J. Peter Mugaas to resolve #7777 and #7778

git-svn-id: trunk@8800 -
This commit is contained in:
florian 2007-10-14 18:02:25 +00:00
parent 00fef0fdd0
commit dab6eec7e2
3 changed files with 746 additions and 731 deletions

View File

@ -92,6 +92,17 @@ begin
MaybeExtension:=Hstr;
end;
function ExtractFileName(const AFilePath : String): String;
var i : Integer;
begin
i := Length(AFilePath);
while (i>0) and (AFilePath[i]<>DirectorySeparator) and
(AFilePath[i]<>DriveSeparator) do
begin
Dec(i);
end;
ExtractFileName := Copy(AFilePath,i+1,Length(AFilePath));
end;
{*****************************************************************************
Options
@ -232,11 +243,10 @@ begin
Usage;
if UnitName='' then
begin
i:=pos('.',outputfilename)-1;
if i<=0 then
UnitName:=outputfilename
else
UnitName:=Copy(OutputFileName,1,i);
UnitName := ExtractFileName(outputfilename);
i:=pos('.',UnitName)-1;
if i>0 then
UnitName:=Copy(UnitName,1,i);
end;
end;

View File

@ -801,31 +801,31 @@ D [0-9]
end;
"void" if NotInCPlusBlock then return(VOID) else skip_until_eol;
"VOID" if NotInCPlusBlock then return(VOID) else skip_until_eol;
"#ifdef __cplusplus"[ \t]*\n"extern \"C\" {"\n"#endif"
"#ifdef"[ \t]*"__cplusplus"[ \t]*\n"extern \"C\" {"\n"#endif"
begin
if not stripinfo then
writeln(outfile,'{ C++ extern C conditionnal removed }');
end;
"#ifdef cplusplus"[ \t]*\n"extern \"C\" {"\n"#endif"
"#ifdef"[ \t]*"cplusplus"[ \t]*\n"extern \"C\" {"\n"#endif"
begin
if not stripinfo then
writeln(outfile,'{ C++ extern C conditionnal removed }');
end;
"#ifdef __cplusplus"[ \t]*\n"}"\n"#endif"
"#ifdef"[ \t]*"__cplusplus"[ \t]*\n"}"\n"#endif"
begin
if not stripinfo then
writeln(outfile,'{ C++ end of extern C conditionnal removed }');
end;
"#ifdef cplusplus"[ \t]*\n"}"\n"#endif"
"#ifdef"[ \t]*"cplusplus"[ \t]*\n"}"\n"#endif"
begin
if not stripinfo then
writeln(outfile,'{ C++ end of extern C conditionnal removed }');
end;
"#ifdef cplusplus"[ \t]*
"#ifdef"[ \t]*"cplusplus"[ \t]*
begin
Inc(cplusblocklevel);
end;
"#ifdef __cplusplus"[ \t]*
"#ifdef"[ \t]*"__cplusplus"[ \t]*
begin
Inc(cplusblocklevel);
end;
@ -1081,3 +1081,4 @@ end.

File diff suppressed because it is too large Load Diff