Răsfoiți Sursa

* fixed compilation with 2.0.x

git-svn-id: trunk@1223 -
peter 20 ani în urmă
părinte
comite
6499d65c39

+ 10 - 10
rtl/freebsd/termiosproc.inc

@@ -18,7 +18,7 @@
                          IOCtl and Termios calls
 ******************************************************************************}
 
-Function TCGetAttr(fd:cint;var tios:TermIOS):cint;
+Function TCGetAttr(fd:cint;var tios:TermIOS):cint; {$ifdef VER2_0}inline;{$endif}
 begin
   TCGETAttr:=fpIoCtl(Fd,TIOCGETA,@tios);
 end;
@@ -43,13 +43,13 @@ begin
 end;
 
 
-Procedure CFSetISpeed(var tios:TermIOS;speed:Cardinal);
+Procedure CFSetISpeed(var tios:TermIOS;speed:Cardinal); {$ifdef VER2_0}inline;{$endif}
 begin
   tios.c_ispeed:=speed; {Probably the Bxxxx speed constants}
 end;
 
 
-Procedure CFSetOSpeed(var tios:TermIOS;speed:Cardinal);
+Procedure CFSetOSpeed(var tios:TermIOS;speed:Cardinal); {$ifdef VER2_0}inline;{$endif}
 begin
    tios.c_ospeed:=speed;
 end;
@@ -73,30 +73,30 @@ begin
    end;
 end;
 
-Function TCSendBreak(fd,duration:cint):cint;
+Function TCSendBreak(fd,duration:cint):cint; {$ifdef VER2_0}inline;{$endif}
 begin
   TCSendBreak:=fpIOCtl(fd,TIOCSBRK,nil);
 end;
 
 
-Function TCSetPGrp(fd,id:cint):cint;
+Function TCSetPGrp(fd,id:cint):cint; {$ifdef VER2_0}inline;{$endif}
 begin
   TCSetPGrp:=fpIOCtl(fd,TIOCSPGRP,pointer(id));
 end;
 
 
-Function TCGetPGrp(fd:cint;var id:cint):cint;
+Function TCGetPGrp(fd:cint;var id:cint):cint; {$ifdef VER2_0}inline;{$endif}
 begin
   TCGetPGrp:=fpIOCtl(fd,TIOCGPGRP,@id);
 end;
 
-Function TCDrain(fd:cint):cint;
+Function TCDrain(fd:cint):cint; {$ifdef VER2_0}inline;{$endif}
 begin
   TCDrain:=fpIOCtl(fd,TIOCDRAIN,nil); {Should set timeout to 1 first?}
 end;
 
 
-Function TCFlow(fd,act:cint):cint;
+Function TCFlow(fd,act:cint):cint; {$ifdef VER2_0}inline;{$endif}
 begin
     case act OF
      TCOOFF :  TCFlow:=fpIoctl(fd,TIOCSTOP,nil);
@@ -105,7 +105,7 @@ begin
     end;
 end;
 
-Function TCFlush(fd,qsel:cint):cint;
+Function TCFlush(fd,qsel:cint):cint; {$ifdef VER2_0}inline;{$endif}
 begin
   TCFlush:=fpIOCtl(fd,TIOCFLUSH,pointer(qsel));
 end;
@@ -121,7 +121,7 @@ begin
 end;
 
 
-Function IsATTY(var f: text):cint;
+Function IsATTY(var f: text):cint; {$ifdef VER2_0}inline;{$endif}
 {
   Idem as previous, only now for text variables.
 }

+ 9 - 0
rtl/freebsd/tthread.inc

@@ -80,8 +80,17 @@ begin
 end;
 
 procedure SemaphorePost(const FSem: Pointer);
+{$ifdef VER2_0}
+var
+  b : byte;
+{$endif}
 begin
+{$ifdef VER2_0}
+  b:=0;
+  fpwrite(PFilDes(FSem)^[1], b, 1);
+{$else}
   fpwrite(PFilDes(FSem)^[1], #0, 1);
+{$endif}
 end;
 
 procedure SemaphoreDestroy(const FSem: Pointer);

+ 10 - 10
rtl/linux/termiosproc.inc

@@ -5,7 +5,7 @@
                          IOCtl and Termios calls
 ******************************************************************************}
 
-Function TCGetAttr(fd:cint;var tios:TermIOS):cint;
+Function TCGetAttr(fd:cint;var tios:TermIOS):cint; {$ifdef VER2_0}inline;{$endif}
 begin
  {$ifndef BSD}
   TCGetAttr:=fpIOCtl(fd,TCGETS,@tios);
@@ -41,7 +41,7 @@ begin
 end;
 
 
-Procedure CFSetISpeed(var tios:TermIOS;speed:Cardinal);
+Procedure CFSetISpeed(var tios:TermIOS;speed:Cardinal); {$ifdef VER2_0}inline;{$endif}
 begin
  {$ifndef BSD}
   tios.c_cflag:=(tios.c_cflag and (not CBAUD)) or speed;
@@ -51,7 +51,7 @@ begin
 end;
 
 
-Procedure CFSetOSpeed(var tios:TermIOS;speed:Cardinal);
+Procedure CFSetOSpeed(var tios:TermIOS;speed:Cardinal); {$ifdef VER2_0}inline;{$endif}
 begin
   {$ifndef BSD}
    CFSetISpeed(tios,speed);
@@ -77,24 +77,24 @@ begin
 end;
 
 
-Function TCSendBreak(fd,duration:cint):cint;
+Function TCSendBreak(fd,duration:cint):cint;  {$ifdef VER2_0}inline;{$endif}
 begin
   TCSendBreak:=fpIOCtl(fd,TCSBRK,pointer(ptrint(duration)));
 end;
 
 
-Function TCSetPGrp(fd,id:cint):cint;
+Function TCSetPGrp(fd,id:cint):cint;  {$ifdef VER2_0}inline;{$endif}
 begin
   TCSetPGrp:=fpIOCtl(fd,TIOCSPGRP,pointer(ptrint(id)));
 end;
 
 
-Function TCGetPGrp(fd:cint;var id:cint):cint;
+Function TCGetPGrp(fd:cint;var id:cint):cint;  {$ifdef VER2_0}inline;{$endif}
 begin
   TCGetPGrp:=fpIOCtl(fd,TIOCGPGRP,@id);
 end;
 
-Function TCDrain(fd:cint):cint;
+Function TCDrain(fd:cint):cint;  {$ifdef VER2_0}inline;{$endif}
 begin
  {$ifndef BSD}
   TCDrain:=fpIOCtl(fd,TCSBRK,pointer(1));
@@ -104,7 +104,7 @@ begin
 end;
 
 
-Function TCFlow(fd,act:cint):cint;
+Function TCFlow(fd,act:cint):cint; {$ifdef VER2_0}inline;{$endif}
 begin
   {$ifndef BSD}
    TCFlow:=fpIOCtl(fd,TCXONC,pointer(ptrint(act)));
@@ -117,7 +117,7 @@ begin
   {$endif}
 end;
 
-Function TCFlush(fd,qsel:cint):cint;
+Function TCFlush(fd,qsel:cint):cint;  {$ifdef VER2_0}inline;{$endif}
 begin
  {$ifndef BSD}
   TCFlush:=fpIOCtl(fd,TCFLSH,pointer(ptrint(qsel)));
@@ -140,7 +140,7 @@ begin
 end;
 
 
-Function IsATTY(var f: text):cint;
+Function IsATTY(var f: text):cint;  {$ifdef VER2_0}inline;{$endif}
 {
   Idem as previous, only now for text variables.
 }

+ 10 - 1
rtl/linux/tthread.inc

@@ -79,8 +79,17 @@ begin
 end;
 
 procedure SemaphorePost(const FSem: Pointer);
+{$ifdef VER2_0}
+var
+  b : byte;
+{$endif}
 begin
+{$ifdef VER2_0}
+  b:=0;
+  fpwrite(PFilDes(FSem)^[1], b, 1);
+{$else}
   fpwrite(PFilDes(FSem)^[1], #0, 1);
+{$endif}
 end;
 
 procedure SemaphoreDestroy(const FSem: Pointer);
@@ -158,7 +167,7 @@ begin
       LThread.FFatalException :=  TObject(AcquireExceptionObject);
       // not sure if we should really do this...
       // but .Destroy was called, so why not try FreeOnTerminate?
-      if e is EThreadDestroyCalled then 
+      if e is EThreadDestroyCalled then
         LThread.FFreeOnTerminate := true;
     end;
   end;

+ 25 - 25
rtl/unix/bunxovl.inc

@@ -20,33 +20,33 @@
 {$I textrec.inc}
 {$I filerec.inc}
 
-Function  FpLink (existing : AnsiString; newone : AnsiString): cInt;
+Function  FpLink (existing : AnsiString; newone : AnsiString): cInt; {$ifdef VER2_0}inline;{$endif}
 Begin
   FpLink:=FpLink(pchar(existing),pchar(newone));
 End;
 
-Function  FpMkfifo (path : AnsiString; Mode : TMode): cInt;
+Function  FpMkfifo (path : AnsiString; Mode : TMode): cInt; {$ifdef VER2_0}inline;{$endif}
 Begin
   FpMkfifo:=FpMkfifo(pchar(path),mode);
 End;
 
-Function  FpChmod (path : AnsiString; Mode : TMode): cInt;
+Function  FpChmod (path : AnsiString; Mode : TMode): cInt; {$ifdef VER2_0}inline;{$endif}
 Begin
   FpChmod:=FpChmod(pchar(path),mode);
 End;
 
-Function  FpChown (path : AnsiString; owner : TUid; group : TGid): cInt;
+Function  FpChown (path : AnsiString; owner : TUid; group : TGid): cInt;{$ifdef VER2_0}inline;{$endif}
 Begin
   FpChown:=FpChown(pchar(path),owner,group);
 End;
 
-Function  FpUtime (path : AnsiString; times : putimbuf): cInt;
+Function  FpUtime (path : AnsiString; times : putimbuf): cInt; {$ifdef VER2_0}inline;{$endif}
 Begin
   FpUtime:=FpUtime(pchar(path),times);
 End;
 
 {
-Function  FpGetcwd (path:AnsiString; siz:TSize):AnsiString;
+Function  FpGetcwd (path:AnsiString; siz:TSize):AnsiString; {$ifdef VER2_0}inline;{$endif}
 Begin
   FpGetcwd:=ansistring(pchar(FpGetcwd(pchar(path),siz)));
 End;
@@ -63,59 +63,59 @@ Begin
     FpGetcwd:=Buf;
 End;
 
-Function  FpExecve (path : AnsiString; argv : ppchar; envp: ppchar): cInt;
+Function  FpExecve (path : AnsiString; argv : ppchar; envp: ppchar): cInt; {$ifdef VER2_0}inline;{$endif}
 Begin
   FpExecve:=FpExecve (pchar(path),argv,envp);
 End;
 
-Function  FpExecv (path : AnsiString; argv : ppchar): cInt;
+Function  FpExecv (path : AnsiString; argv : ppchar): cInt; {$ifdef VER2_0}inline;{$endif}
 Begin
   FpExecv:=FpExecve (pchar(path),argv,envp);
 End;
 
 
-Function  FpChdir (path : AnsiString): cInt;
+Function  FpChdir (path : AnsiString): cInt; {$ifdef VER2_0}inline;{$endif}
 Begin
  FpChDir:=FpChdir(pchar(Path));
 End;
 
-Function  FpOpen (path : AnsiString; flags : cInt; Mode: TMode):cInt;
+Function  FpOpen (path : AnsiString; flags : cInt; Mode: TMode):cInt; {$ifdef VER2_0}inline;{$endif}
 Begin
   FpOpen:=FpOpen(pchar(Path),flags,mode);
 End;
 
 
-Function  FpMkdir (path : AnsiString; Mode: TMode):cInt;
+Function  FpMkdir (path : AnsiString; Mode: TMode):cInt; {$ifdef VER2_0}inline;{$endif}
 Begin
   FpMkdir:=FpMkdir(pchar(Path),mode);
 End;
 
-Function  FpUnlink (path : AnsiString): cInt;
+Function  FpUnlink (path : AnsiString): cInt; {$ifdef VER2_0}inline;{$endif}
 Begin
   FpUnlink:=FpUnlink(pchar(path));
 End;
 
-Function  FpRmdir (path : AnsiString): cInt;
+Function  FpRmdir (path : AnsiString): cInt; {$ifdef VER2_0}inline;{$endif}
 Begin
   FpRmdir:=FpRmdir(pchar(path));
 End;
 
-Function  FpRename (old  : AnsiString;newpath: AnsiString): cInt;
+Function  FpRename (old  : AnsiString;newpath: AnsiString): cInt; {$ifdef VER2_0}inline;{$endif}
 Begin
   FpRename:=FpRename(pchar(old),pchar(newpath));
 End;
 
-Function  FpStat (path: AnsiString; var buf : stat): cInt;
+Function  FpStat (path: AnsiString; var buf : stat): cInt; {$ifdef VER2_0}inline;{$endif}
 begin
   FpStat:=FpStat(pchar(path),buf);
 End;
 
-Function FpAccess (pathname : AnsiString; aMode : cInt): cInt;
+Function FpAccess (pathname : AnsiString; aMode : cInt): cInt; {$ifdef VER2_0}inline;{$endif}
 Begin
   FpAccess:=FpAccess(pchar(pathname),amode);
 End;
 
-Function  FPFStat(var F:Text;Var Info:stat):Boolean;
+Function  FPFStat(var F:Text;Var Info:stat):Boolean; {$ifdef VER2_0}inline;{$endif}
 {
   Get all information on a text file, and return it in info.
 }
@@ -123,7 +123,7 @@ begin
   FPFStat:=FPFstat(TextRec(F).Handle,INfo)=0;
 end;
 
-Function  FPFStat(var F:File;Var Info:stat):Boolean;
+Function  FPFStat(var F:File;Var Info:stat):Boolean; {$ifdef VER2_0}inline;{$endif}
 {
   Get all information on a untyped file, and return it in info.
 }
@@ -164,24 +164,24 @@ function xFpread(fd: cint; buf: pchar; nbytes : size_t): ssize_t; cdecl; externa
 function xFpread(fd: cint; buf: pchar; nbytes : size_t): ssize_t; external name 'FPC_SYSC_READ';
 {$endif}
 
-Function  FpRead           (fd : cInt;var buf; nbytes : TSize): TSsize;
+Function  FpRead           (fd : cInt;var buf; nbytes : TSize): TSsize; {$ifdef VER2_0}inline;{$endif}
 
 begin
   FPRead:=xFpRead(fd,pchar(@buf),nbytes);
 end;
 
-Function  FpWrite          (fd : cInt;const buf; nbytes : TSize): TSsize;
+Function  FpWrite          (fd : cInt;const buf; nbytes : TSize): TSsize; {$ifdef VER2_0}inline;{$endif}
 begin
  FpWrite:=FpWrite(fd,pchar(@buf),nbytes);
 end;
 
-Function  FpOpen    (path : pChar; flags : cInt):cInt;
+Function  FpOpen    (path : pChar; flags : cInt):cInt; {$ifdef VER2_0}inline;{$endif}
 
 begin
  FpOpen:=FpOpen(path,flags,438);
 end;
 
-Function  FpOpen    (path : AnsiString; flags : cInt):cInt;
+Function  FpOpen    (path : AnsiString; flags : cInt):cInt; {$ifdef VER2_0}inline;{$endif}
 
 begin
  FpOpen:=FpOpen(pchar(path),flags,438);
@@ -201,13 +201,13 @@ begin
  FpOpen:=FpOpen(@path[1],flags,Mode);
 end;
 
-Function  FpOpendir (dirname : AnsiString): pDir;
+Function  FpOpendir (dirname : AnsiString): pDir; {$ifdef VER2_0}inline;{$endif}
 Begin
   FpOpenDir:=FpOpenDir(pchar(dirname));
 End;
 
 
-Function  FpOpendir (dirname : shortString): pDir;
+Function  FpOpendir (dirname : shortString): pDir; {$ifdef VER2_0}inline;{$endif}
 Begin
   dirname:=dirname+#0;
   FpOpenDir:=FpOpenDir(pchar(@dirname[1]));
@@ -283,7 +283,7 @@ begin
   fpDup2:=fpDup2(filerec(oldfile).handle,filerec(newfile).handle);
 end;
 
-function  fptime    :time_t;
+function  fptime    :time_t;  {$ifdef VER2_0}inline;{$endif}
 var t:time_t;
 begin
   fptime:=fptime(t);

+ 10 - 10
rtl/unix/bunxovlh.inc

@@ -20,16 +20,16 @@ Function  FpMkfifo  (path : AnsiString; Mode : TMode): cInt; inline;
 Function  FpChmod   (path : AnsiString; Mode : TMode): cInt; inline;
 Function  FpChown   (path : AnsiString; owner : TUid; group : TGid): cInt; inline;
 Function  FpUtime   (path : AnsiString; times : putimbuf): cInt; inline;
-Function  FpGetcwd : AnsiString; 
+Function  FpGetcwd : AnsiString;
 Function  FpExecve  (path : AnsiString; argv : ppchar; envp: ppchar): cInt; inline;
 Function  FpExecv   (path : AnsiString; argv : ppchar): cInt; inline;
 Function  FpOpendir (dirname : AnsiString): pDir; inline;
-Function  FpOpendir (dirname : shortString): pDir;
-Function  FpOpen    (path : pChar; flags : cInt):cInt;
+Function  FpOpendir (dirname : shortString): pDir; inline;
+Function  FpOpen    (path : pChar; flags : cInt):cInt; inline;
 Function  FpOpen    (path : AnsiString; flags : cInt):cInt; inline;
 Function  FpOpen    (path : AnsiString; flags : cInt; Mode: TMode):cInt; inline;
-Function  FpOpen    (path : String; flags : cInt):cInt; 
-Function  FpOpen    (path : String; flags : cInt; Mode: TMode):cInt; 
+Function  FpOpen    (path : String; flags : cInt):cInt;
+Function  FpOpen    (path : String; flags : cInt; Mode: TMode):cInt;
 Function  FpChdir   (path : AnsiString): cInt; inline;
 Function  FpMkdir   (path : AnsiString; Mode: TMode):cInt; inline;
 Function  FpUnlink  (path : AnsiString): cInt; inline;
@@ -48,14 +48,14 @@ Function  FPFStat   (var F:File;Var Info:stat):Boolean; inline;
 Function  FpSignal  (signum:longint;Handler:signalhandler):signalhandler;
 Function  FpRead    (fd : cInt; var buf; nbytes : TSize): TSsize; inline;
 Function  FpWrite   (fd : cInt; const buf; nbytes : TSize): TSsize; inline;
-Function  FpDup     (var oldfile,newfile:text):cint; inline;
-Function  FpDup     (var oldfile,newfile:file):cint; inline;
-Function  FpDup2    (var oldfile,newfile:text):cint; 
-Function  FpDup2    (var oldfile,newfile:file):cint; inline;
+Function  FpDup     (var oldfile,newfile:text):cint;
+Function  FpDup     (var oldfile,newfile:file):cint;
+Function  FpDup2    (var oldfile,newfile:text):cint;
+Function  FpDup2    (var oldfile,newfile:file):cint;
 function  fptime    :time_t; inline;
 
 
-Function fpSelect   (N:cint;readfds,writefds,exceptfds:pfdset;TimeOut:cint):cint; 
+Function fpSelect   (N:cint;readfds,writefds,exceptfds:pfdset;TimeOut:cint):cint;
 Function fpSelect   (var T:Text;TimeOut :PTimeval):cint;
 Function fpSelect   (var T:Text;TimeOut :time_t):cint;
 Function FpGetEnv   (name : String): pChar;