mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 00:28:23 +02:00
Implement length(PWideChar) with IndexWord.
This commit is contained in:
parent
fe41a51db3
commit
875e22f7d7
@ -1290,13 +1290,11 @@ end;
|
||||
{$ifndef FPC_SYSTEM_HAS_FPC_PWIDECHAR_LENGTH}
|
||||
|
||||
function fpc_pwidechar_length(p:pwidechar):sizeint;[public,alias:'FPC_PWIDECHAR_LENGTH']; compilerproc;
|
||||
var i : sizeint;
|
||||
begin
|
||||
i:=0;
|
||||
if assigned(p) then
|
||||
while p[i]<>#0 do
|
||||
inc(i);
|
||||
exit(i);
|
||||
Result:=IndexWord(p^,-1,0)
|
||||
else
|
||||
result:=0;
|
||||
end;
|
||||
|
||||
{$endif ndef FPC_SYSTEM_HAS_FPC_PWIDECHAR_LENGTH}
|
||||
|
Loading…
Reference in New Issue
Block a user