codetools: ParseFPCParameters: case insensitive defines

git-svn-id: trunk@53183 -
This commit is contained in:
mattias 2016-10-20 19:48:07 +00:00
parent bd2ab5c7bc
commit 94d76f9a59
2 changed files with 7 additions and 2 deletions

View File

@ -2740,11 +2740,15 @@ const
aKind:=fpkValue;
end;
if not (aKind in [fpkUnknown,fpkConfig,fpkNonOption,fpkMultiValue]) then
if (aKind in [fpkBoolean,fpkValue,fpkDefine]) then
// check for duplicates
for i:=0 to ParsedParams.Count-1 do begin
Param:=TFPCParamValue(ParsedParams[i]);
if (Param.Name<>aName) then continue;
if aKind=fpkDefine then begin
if CompareText(Param.Name,aName)<>0 then continue;
end else begin
if (Param.Name<>aName) then continue;
end;
if (aKind=fpkDefine) <> (Param.Kind=fpkDefine) then continue;
// was already set
Include(Param.Flags,fpfSetTwice);

View File

@ -511,6 +511,7 @@ begin
t('-Tfoo','T','foo',fpkValue,[]);
t('-uMacro','Macro','',fpkDefine,[fpfUnset]);
t('-dMacro -uMacro','Macro','',fpkDefine,[fpfUnset,fpfSetTwice,fpfValueChanged]);
t('-dmacro -uMACRO','macro','',fpkDefine,[fpfUnset,fpfSetTwice,fpfValueChanged]);
t('-Uns-','Us','',fpkBoolean,[fpfUnset]);
t('-vwne','ve',FPCParamEnabled,fpkBoolean,[]);
t('-vmfoo','vm','foo',fpkMultiValue,[]);