浏览代码

* forgotten commit (part of last commit)

git-svn-id: trunk@8899 -
florian 18 年之前
父节点
当前提交
6b8466633e
共有 1 个文件被更改,包括 24 次插入1 次删除
  1. 24 1
      rtl/inc/strings.pp

+ 24 - 1
rtl/inc/strings.pp

@@ -14,10 +14,12 @@
  **********************************************************************}
 unit strings;
 {$S-}
+{$inline on}
 interface
 
     { Implemented in System Unit }
-    function strpas(p:pchar):shortstring;external name 'FPC_PCHAR_TO_SHORTSTR';
+    function strpas(p:pchar):shortstring;inline;
+
     function strlen(p:pchar):sizeint;external name 'FPC_PCHAR_LENGTH';
 
     { Converts a Pascal string to a null-terminated string }
@@ -109,6 +111,27 @@ implementation
 
 { Functions, different from the one in sysutils }
 
+{$ifndef FPC_STRTOSHORTSTRINGPROC}
+
+    { also define alias which can be used inside the system unit }
+    function fpc_pchar_to_shortstr(p:pchar):shortstring;[external name 'FPC_PCHAR_TO_SHORTSTR'];
+
+{$else FPC_STRTOSHORTSTRINGPROC}
+
+    { also define alias which can be used inside the system unit }
+    procedure fpc_pchar_to_shortstr(var res : openstring;p:pchar);[external name 'FPC_PCHAR_TO_SHORTSTR'];
+
+{$endif FPC_STRTOSHORTSTRINGPROC}
+
+    function strpas(p:pchar):shortstring;{$ifdef SYSTEMINLINE}inline;{$endif}
+      begin
+    {$ifndef FPC_STRTOSHORTSTRINGPROC}
+        strpas:=fpc_pchar_to_shortstr(p);
+    {$else FPC_STRTOSHORTSTRINGPROC}
+        fpc_pchar_to_shortstr(strpas,p);
+    {$endif FPC_STRTOSHORTSTRINGPROC}
+      end;
+
     function stralloc(L : SizeInt) : pchar;
 
       begin