mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-20 09:49:08 +02:00
* fixes excluding of cpu capabilities
This commit is contained in:
parent
a868a45ba9
commit
89aeedac1e
@ -95,6 +95,8 @@ interface
|
|||||||
function trimspace(const s:string):string;
|
function trimspace(const s:string):string;
|
||||||
function trimspace(const s:AnsiString):AnsiString;
|
function trimspace(const s:AnsiString):AnsiString;
|
||||||
function space (b : longint): string;
|
function space (b : longint): string;
|
||||||
|
{ returns the position of the first char of the set cs in s, if there is none, then it returns 0 }
|
||||||
|
function PosCharset(const cs : TCharSet;const s : ansistring) : integer;
|
||||||
function PadSpace(const s:string;len:longint):string;
|
function PadSpace(const s:string;len:longint):string;
|
||||||
function PadSpace(const s:AnsiString;len:longint):AnsiString;
|
function PadSpace(const s:AnsiString;len:longint):AnsiString;
|
||||||
function GetToken(var s:string;endchar:char):string;
|
function GetToken(var s:string;endchar:char):string;
|
||||||
@ -1181,6 +1183,21 @@ implementation
|
|||||||
result^:=s;
|
result^:=s;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function PosCharset(const cs : TCharSet;const s : ansistring) : integer;
|
||||||
|
var
|
||||||
|
i : integer;
|
||||||
|
begin
|
||||||
|
result:=0;
|
||||||
|
for i:=1 to length(s) do
|
||||||
|
if s[i] in cs then
|
||||||
|
begin
|
||||||
|
result:=i;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function CompareStr(const S1, S2: string): Integer;
|
function CompareStr(const S1, S2: string): Integer;
|
||||||
var
|
var
|
||||||
count, count1, count2: integer;
|
count, count1, count2: integer;
|
||||||
|
@ -1708,12 +1708,13 @@ begin
|
|||||||
begin
|
begin
|
||||||
s:=upper(copy(more,j+1,length(more)-j));
|
s:=upper(copy(more,j+1,length(more)-j));
|
||||||
{$ifdef cpucapabilities}
|
{$ifdef cpucapabilities}
|
||||||
if (pos('+',s)<>0) or (pos('-',s)<>0) then
|
{ find first occurrence of + or - }
|
||||||
|
deletepos:=PosCharset(['+','-'],s);
|
||||||
|
if deletepos<>0 then
|
||||||
begin
|
begin
|
||||||
deletepos:=min(pos('+',s),pos('-',s));
|
extrasettings:=Copy(s,deletepos,Length(s));
|
||||||
extrasettings:=Copy(s,Pos('+',s),Length(s));
|
Delete(s,deletepos,Length(s));
|
||||||
Delete(s,Pos('+',s),Length(s));
|
end
|
||||||
end
|
|
||||||
else
|
else
|
||||||
extrasettings:='';
|
extrasettings:='';
|
||||||
{$endif cpucapabilities}
|
{$endif cpucapabilities}
|
||||||
@ -1724,16 +1725,12 @@ begin
|
|||||||
begin
|
begin
|
||||||
Delete(extrasettings,1,1);
|
Delete(extrasettings,1,1);
|
||||||
includecapability:=true;
|
includecapability:=true;
|
||||||
if Pos('+',extrasettings)<>0 then
|
deletepos:=PosCharset(['+','-'],extrasettings);
|
||||||
|
if deletepos<>0 then
|
||||||
begin
|
begin
|
||||||
s:=Copy(extrasettings,1,Pos('+',extrasettings)-1);
|
includecapability:=extrasettings[deletepos]='+';
|
||||||
Delete(extrasettings,1,Pos('+',extrasettings)-1);
|
s:=Copy(extrasettings,1,deletepos-1);
|
||||||
end
|
Delete(extrasettings,1,deletepos-1);
|
||||||
else if Pos('-',extrasettings)<>0 then
|
|
||||||
begin
|
|
||||||
s:=Copy(extrasettings,1,Pos('+',extrasettings)-1);
|
|
||||||
Delete(extrasettings,1,Pos('+',extrasettings)-1);
|
|
||||||
includecapability:=false;
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user