|
@@ -693,31 +693,19 @@ begin
|
|
else
|
|
else
|
|
exit(0);
|
|
exit(0);
|
|
end;
|
|
end;
|
|
|
|
+{$endif ndef FPC_SYSTEM_HAS_FPC_SHORTSTR_COMPARE}
|
|
|
|
|
|
-function fpc_shortstr_compare_equal(const left,right:shortstring) : longint;[public,alias:'FPC_SHORTSTR_COMPARE_EQUAL']; compilerproc;
|
|
|
|
-var
|
|
|
|
- s1,s2,i : byte;
|
|
|
|
- d : longint;
|
|
|
|
|
|
+
|
|
|
|
+{$ifndef FPC_SYSTEM_HAS_FPC_SHORTSTR_COMPARE_EQUAL}
|
|
|
|
+function fpc_shortstr_compare_equal(const left,right:shortstring): longint; [public,alias:'FPC_SHORTSTR_COMPARE_EQUAL']; compilerproc;
|
|
begin
|
|
begin
|
|
- s1:=length(left);
|
|
|
|
- s2:=length(right);
|
|
|
|
- if s1<>s2 then
|
|
|
|
- exit(-1)
|
|
|
|
- else
|
|
|
|
- for i:=1 to s1 do
|
|
|
|
- begin
|
|
|
|
- d:=byte(left[i])-byte(right[i]);
|
|
|
|
- if d>0 then
|
|
|
|
- exit(1)
|
|
|
|
- else if d<0 then
|
|
|
|
- exit(-1);
|
|
|
|
- end;
|
|
|
|
- exit(0);
|
|
|
|
|
|
+ Result := longint(left[0]) - longint(right[0]);
|
|
|
|
+ if Result = 0 then
|
|
|
|
+ Result := CompareByte(left[1],right[1], longint(left[0]));
|
|
end;
|
|
end;
|
|
|
|
+{$endif ndef FPC_SYSTEM_HAS_FPC_SHORTSTR_COMPARE_EQUAL}
|
|
|
|
|
|
|
|
|
|
-{$endif ndef FPC_SYSTEM_HAS_FPC_SHORTSTR_COMPARE}
|
|
|
|
-
|
|
|
|
{$ifndef FPC_SYSTEM_HAS_FPC_PCHAR_TO_SHORTSTR}
|
|
{$ifndef FPC_SYSTEM_HAS_FPC_PCHAR_TO_SHORTSTR}
|
|
|
|
|
|
function fpc_pchar_to_shortstr(p:pchar):shortstring;[public,alias:'FPC_PCHAR_TO_SHORTSTR']; compilerproc;
|
|
function fpc_pchar_to_shortstr(p:pchar):shortstring;[public,alias:'FPC_PCHAR_TO_SHORTSTR']; compilerproc;
|