From 7fcf8330014e11e63afaf75df9fc9c66c9aac298 Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 12 Jan 2005 10:27:55 +0000 Subject: [PATCH] improved priority checking for FPC source units git-svn-id: trunk@6555 - --- components/codetools/definetemplates.pas | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/components/codetools/definetemplates.pas b/components/codetools/definetemplates.pas index 901066bf4c..cc936a2a2d 100644 --- a/components/codetools/definetemplates.pas +++ b/components/codetools/definetemplates.pas @@ -3004,7 +3004,7 @@ var ADirPath:=ADirPath+PathDelim; // set directory priority Priority:=0; - if System.Pos(FPCSrcDir+PathDelim+'rtl'+PathDelim,ADirPath)>0 then + if System.Pos(AppendPathDelim(FPCSrcDir)+'rtl'+PathDelim,ADirPath)>0 then Priority:=1; // search sources .pp,.pas if FindFirst(ADirPath+FileMask,faAnyFile,FileInfo)=0 then begin @@ -3105,17 +3105,18 @@ var $(#FPCSrcDir)/fcl/classes/$(#TargetOS)/classes.pp Rulez: + - A unit in the rtl is preferred above one in the fcl - a filename with macros is preferred above one without This skips the templates. - - A unit in the rtl is preferred before the fcl - A macro fitting better with the current settings is preferred. For example: If the current OS is linux then on fpc 1.0.x: $(#FPCSrcDir)/fcl/classes/$(#TargetOS)/classes.pp } - if (Priority>=OldUnitLink.Priority) - and ((FileNameMacroCount(OldUnitLink.Filename)=0) - or (OldUnitLink.DefaultMacroCountOldUnitLink.Priority) + or ((Priority=OldUnitLink.Priority) + and ((FileNameMacroCount(OldUnitLink.Filename)=0) + or (OldUnitLink.DefaultMacroCount