Преглед на файлове

* fixed version of fpc_pchar_length() for JVM (the generic one passes
p^ to indexbyte, and since indexbyte takes an open array parameter
on the JVM platform rather than an untyped var, this was converted
to a single element array rather than passing in p unmodified)

git-svn-id: trunk@33568 -

Jonas Maebe преди 9 години
родител
ревизия
6e2523b199
променени са 1 файла, в които са добавени 11 реда и са изтрити 0 реда
  1. 11 0
      rtl/jvm/jvm.inc

+ 11 - 0
rtl/jvm/jvm.inc

@@ -274,6 +274,17 @@ function  IndexWord(const buf: array of jchar;len:SizeInt;b:jshort):SizeInt;
                                  String
                                  String
 ****************************************************************************}
 ****************************************************************************}
 
 
+{$define FPC_SYSTEM_HAS_FPC_PCHAR_LENGTH}
+
+function fpc_pchar_length(p:pchar):sizeint;[public,alias:'FPC_PCHAR_LENGTH']; compilerproc;
+begin
+  if assigned(p) then
+    Result:=IndexByte(TAnsiCharArray(p),high(Result),0)
+  else
+    Result:=0;
+end;
+
+
 {$define FPC_SYSTEM_HAS_FPC_PCHAR_TO_SHORTSTR}
 {$define FPC_SYSTEM_HAS_FPC_PCHAR_TO_SHORTSTR}
 procedure fpc_pchar_to_shortstr(out res : shortstring;p:pchar); compilerproc;
 procedure fpc_pchar_to_shortstr(out res : shortstring;p:pchar); compilerproc;
 var
 var