+ search_unit arg to only search for sources

This commit is contained in:
peter 1998-11-03 11:33:11 +00:00
parent 9d9f60c4d6
commit 436274abfc
2 changed files with 36 additions and 29 deletions

View File

@ -167,7 +167,7 @@ unit files;
procedure reset; procedure reset;
procedure setfilename(const fn:string;allowoutput:boolean); procedure setfilename(const fn:string;allowoutput:boolean);
function openppu:boolean; function openppu:boolean;
function search_unit(const n : string):boolean; function search_unit(const n : string;onlysource:boolean):boolean;
end; end;
pused_unit = ^tused_unit; pused_unit = ^tused_unit;
@ -742,7 +742,7 @@ unit files;
end; end;
function tmodule.search_unit(const n : string):boolean; function tmodule.search_unit(const n : string;onlysource:boolean):boolean;
var var
ext : string[8]; ext : string[8];
singlepathstring, singlepathstring,
@ -769,6 +769,8 @@ unit files;
i:=length(unitpath)+1; i:=length(unitpath)+1;
singlepathstring:=FixPath(copy(unitpath,start,i-start),false); singlepathstring:=FixPath(copy(unitpath,start,i-start),false);
delete(unitpath,start,i-start+1); delete(unitpath,start,i-start+1);
if not onlysource then
begin
{ Check for PPL file } { Check for PPL file }
if not Found then if not Found then
begin begin
@ -789,6 +791,7 @@ unit files;
Found:=OpenPPU; Found:=OpenPPU;
End; End;
end; end;
end;
{ Check for Sources } { Check for Sources }
if not Found then if not Found then
begin begin
@ -941,8 +944,8 @@ unit files;
{ search the PPU file if it is an unit } { search the PPU file if it is an unit }
if is_unit then if is_unit then
begin begin
if (not search_unit(modulename^)) and (length(modulename^)>8) then if (not search_unit(modulename^,false)) and (length(modulename^)>8) then
search_unit(copy(modulename^,1,8)); search_unit(copy(modulename^,1,8),false);
end; end;
end; end;
@ -1024,7 +1027,10 @@ unit files;
end. end.
{ {
$Log$ $Log$
Revision 1.69 1998-10-29 11:35:44 florian Revision 1.70 1998-11-03 11:33:14 peter
+ search_unit arg to only search for sources
Revision 1.69 1998/10/29 11:35:44 florian
* some dll support for win32 * some dll support for win32
* fixed assembler writing for PalmOS * fixed assembler writing for PalmOS

View File

@ -325,9 +325,9 @@ unit pmodules;
end; end;
{ recompile the unit or give a fatal error if sources not available } { recompile the unit or give a fatal error if sources not available }
if not(current_module^.sources_avail) then if not(current_module^.sources_avail) then
if (not current_module^.search_unit(current_module^.modulename^)) if (not current_module^.search_unit(current_module^.modulename^,true))
and (length(current_module^.modulename^)>8) then and (length(current_module^.modulename^)>8) then
current_module^.search_unit(copy(current_module^.modulename^,1,8)); current_module^.search_unit(copy(current_module^.modulename^,1,8),true);
if not(current_module^.sources_avail) then if not(current_module^.sources_avail) then
Message1(unit_f_cant_compile_unit,current_module^.modulename^) Message1(unit_f_cant_compile_unit,current_module^.modulename^)
else else
@ -411,10 +411,8 @@ unit pmodules;
hp^.reset; hp^.reset;
hp^.scanner:=scanner; hp^.scanner:=scanner;
{ try to reopen ppu } { try to reopen ppu }
hp^.search_unit(s); hp^.search_unit(s,false);
{ try to load the unit a second time first } { try to load the unit a second time first }
{ if not current_module^.in_implementation then
hp^.do_compile:=true; }
current_module:=hp; current_module:=hp;
current_module^.in_second_compile:=true; current_module^.in_second_compile:=true;
Message1(unit_u_second_load_unit,current_module^.modulename^); Message1(unit_u_second_load_unit,current_module^.modulename^);
@ -1112,7 +1110,10 @@ unit pmodules;
end. end.
{ {
$Log$ $Log$
Revision 1.78 1998-10-30 12:23:41 peter Revision 1.79 1998-11-03 11:33:11 peter
+ search_unit arg to only search for sources
Revision 1.78 1998/10/30 12:23:41 peter
* fix for lognunitname and longunit.pas * fix for lognunitname and longunit.pas
Revision 1.77 1998/10/29 11:35:52 florian Revision 1.77 1998/10/29 11:35:52 florian