Explorar o código

* Made getopts compilable. Its ansi only.

git-svn-id: branches/unicodertl@12180 -
yury %!s(int64=17) %!d(string=hai) anos
pai
achega
5c1e41bea6
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      rtl/inc/getopts.pp

+ 4 - 3
rtl/inc/getopts.pp

@@ -60,7 +60,7 @@ Implementation
                                Create an ArgV
                                Create an ArgV
 ***************************************************************************}
 ***************************************************************************}
 
 
-{$IF not Declared(argv)} //{$ifdef TP}
+{$IF not Declared(argv) or (sizeof(RtlChar)<>1)} //{$ifdef TP}
 
 
 type
 type
   ppchar = ^pchar;
   ppchar = ^pchar;
@@ -84,7 +84,8 @@ begin
   s:=paramstr(0);
   s:=paramstr(0);
   arglen:=length(s);
   arglen:=length(s);
   getmem(argsbuf[0],arglen + 1);
   getmem(argsbuf[0],arglen + 1);
-  strpcopy(argsbuf[0],s);
+  move(s[1], argsbuf[0]^, arglen);
+  argsbuf[0][arglen]:=#0;
 { create commandline }
 { create commandline }
   s:='';
   s:='';
   for i:=1 to paramcount do
   for i:=1 to paramcount do
@@ -501,7 +502,7 @@ end;
   {$endif}
   {$endif}
 {$endif}
 {$endif}
 { create argv if running under TP }
 { create argv if running under TP }
-{$ifndef FPC}
+{$if not defined(FPC) or (sizeof(RtlChar)<>1)}
   setup_arguments;
   setup_arguments;
 {$endif}
 {$endif}
 { Needed to detect startup }
 { Needed to detect startup }