Browse Source

Merged revisions 11144,11148,11236,11348,11461,11994,12003 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r11144 | Almindor | 2008-05-31 23:10:18 +0200 (So, 31 máj 2008) | 2 lines

* add UDP and TCP setsockopt constants (linux)

........
r11148 | Almindor | 2008-06-01 00:06:56 +0200 (Ne, 01 jún 2008) | 2 lines

* add TCP and UDP setsockopt option constants to all unix-likes

........
r11236 | Almindor | 2008-06-16 20:30:38 +0200 (Po, 16 jún 2008) | 2 lines

* fix memory leaks in create_dwarf and types_dec procedures thanks to Giulio Bernardi's detailed report

........
r11348 | Almindor | 2008-07-07 23:21:44 +0200 (Po, 07 júl 2008) | 2 lines

* patch from Vincent to fix TReader.ReadCollection calling clear() logic

........
r11461 | Almindor | 2008-07-26 12:31:23 +0200 (So, 26 júl 2008) | 2 lines

* inline the ** operators since they just call functions directly

........
r11994 | Almindor | 2008-10-29 20:17:53 +0100 (St, 29 okt 2008) | 2 lines

* proper fix for the kqueue struct. Use PtrUInt and PtrInt respectively...

........
r12003 | Almindor | 2008-10-31 19:19:44 +0100 (Pi, 31 okt 2008) | 2 lines

* remove unused oldfpccall from amd64 BSD syscall code

........

git-svn-id: branches/fixes_2_2@12104 -

Almindor 17 years ago
parent
commit
657bea6428

+ 2 - 2
compiler/pdecl.pas

@@ -575,11 +575,11 @@ implementation
                { Generic is never a type renaming }
                hdef.typesym:=newtype;
              end;
+           if assigned(generictypelist) then
+             generictypelist.free;
          until token<>_ID;
          typecanbeforward:=false;
          symtablestack.top.SymList.ForEachCall(@resolve_type_forward,nil);
-         if assigned(generictypelist) then
-           generictypelist.free;
          block_type:=old_block_type;
       end;
 

+ 2 - 1
compiler/pmodules.pas

@@ -133,7 +133,8 @@ implementation
         if (tf_needs_dwarf_cfi in target_info.flags) and
            (af_supports_dwarf in target_asm.flags) then
           begin
-            current_asmdata.asmlists[al_dwarf]:=TAsmList.create;
+            current_asmdata.asmlists[al_dwarf].Free;
+            current_asmdata.asmlists[al_dwarf] := TAsmList.create;
             current_asmdata.asmcfi.generate_code(current_asmdata.asmlists[al_dwarf]);
           end;
       end;

+ 6 - 6
rtl/bsd/bsd.pas

@@ -93,11 +93,11 @@ const
 type
   PKEvent = ^TKEvent;
   TKEvent = record
-    Ident  : cuint;      { identifier for this event }
+    Ident  : PtrUInt;      { identifier for this event }
     Filter : cshort;     { filter for event }
     Flags  : cushort;
     FFlags : cuint;
-    Data   : cint;
+    Data   : PtrInt;
     uData  : Pointer;    { opaque user data identifier }
   end;
 
@@ -106,9 +106,9 @@ function kqueue: cint; extdecl;
 function kevent(kq: cint; ChangeList: PKEvent; nChanged: cint;
                   EventList: PKevent; nEvents: cint; Timeout: PTimeSpec): cint; extdecl;
 
-procedure EV_SET(kevp: PKEvent; const aIdent: cuint; const aFilter: cshort;
+procedure EV_SET(kevp: PKEvent; const aIdent: PtrUInt; const aFilter: cshort;
                    const aFlags: cushort; const aFFlags: cuint;
-                   const aData: cint; const auData: Pointer);  inline;
+                   const aData: PtrInt; const auData: Pointer);  inline;
 
 implementation
 
@@ -117,8 +117,8 @@ uses
   SysCall;
 {$endif}
 
-procedure EV_SET(kevp: PKEvent; const aIdent: cuint; const aFilter: cshort; const aFlags: cushort;
-                                const aFFlags: cuint; const aData: cint; const auData: Pointer); inline;
+procedure EV_SET(kevp: PKEvent; const aIdent: PtrUInt; const aFilter: cshort; const aFlags: cushort;
+                                const aFFlags: cuint; const aData: PtrInt; const auData: Pointer); inline;
 begin
   kevp^.Ident  := aIdent;
   kevp^.Filter := aFilter;

+ 9 - 9
rtl/bsd/x86_64/syscallh.inc

@@ -32,16 +32,16 @@ Type
 
   TSysParam  = int64;
 
-function do_sysCall(sysnr:TSysParam):TSysResult;oldfpccall;   external name 'FPC_DOSYS0';
-function do_sysCall(sysnr,param1:TSysParam):TSysResult; oldfpccall;external name 'FPC_DOSYS1';
-function do_sysCall(sysnr,param1,param2:TSysParam):TSysResult; oldfpccall; external name 'FPC_DOSYS2';
-function do_sysCall(sysnr,param1,param2,param3:TSysParam):TSysResult;oldfpccall; external name 'FPC_DOSYS3';
-function do_sysCall(sysnr,param1,param2,param3,param4:TSysParam):TSysResult;oldfpccall; external name 'FPC_DOSYS4';
-function do_sysCall(sysnr,param1,param2,param3,param4,param5:TSysParam):TSysResult; oldfpccall;  external name 'FPC_DOSYS5';
-function do_sysCall(sysnr,param1,param2,param3,param4,param5,param6:TSysParam):int64;oldfpccall;  external name 'FPC_DOSYS6';
-//function do_sysCall(sysnr,param1,param2,param3,param4,param5,param6,param7:TSysParam):int64;oldfpccall;  external name 'FPC_DOSYS7';
+function do_sysCall(sysnr:TSysParam):TSysResult; external name 'FPC_DOSYS0';
+function do_sysCall(sysnr,param1:TSysParam):TSysResult; external name 'FPC_DOSYS1';
+function do_sysCall(sysnr,param1,param2:TSysParam):TSysResult;  external name 'FPC_DOSYS2';
+function do_sysCall(sysnr,param1,param2,param3:TSysParam):TSysResult; external name 'FPC_DOSYS3';
+function do_sysCall(sysnr,param1,param2,param3,param4:TSysParam):TSysResult; external name 'FPC_DOSYS4';
+function do_sysCall(sysnr,param1,param2,param3,param4,param5:TSysParam):TSysResult; external name 'FPC_DOSYS5';
+function do_sysCall(sysnr,param1,param2,param3,param4,param5,param6:TSysParam):int64; external name 'FPC_DOSYS6';
+function do_sysCall(sysnr,param1,param2,param3,param4,param5,param6,param7:TSysParam):int64; external name 'FPC_DOSYS7';
 
 // special
-function do__sysCall(sysnr,param1,param2,param3,param4,param5,param6,param7,Param8:TSysParam):TSysResult; oldfpccall;  external name 'FPC__DOSYS';
+function do__sysCall(sysnr,param1,param2,param3,param4,param5,param6,param7,Param8:TSysParam):TSysResult; external name 'FPC__DOSYS';
 {$endif}
 

+ 13 - 0
rtl/darwin/unxsockh.inc

@@ -324,3 +324,16 @@ Const
   MSG_COMPAT     = $8000;              { used in sendit() }
   MSG_NEEDSA     = $10000;             { Fail receive if socket address cannot be allocated }
 
+     TCP_NODELAY = $01;
+  { set maximum segment size  }
+     TCP_MAXSEG = $02;
+  { don't push last block of write  }
+     TCP_NOPUSH = $04;
+  { don't use TCP options  }
+     TCP_NOOPT = $08;
+  { idle time used when SO_KEEPALIVE is enabled  }
+     TCP_KEEPALIVE = $10;
+     
+  { don't checksum outbound payloads }
+     UDP_NOCKSUM = $01;
+

+ 14 - 0
rtl/freebsd/unxsockh.inc

@@ -349,3 +349,17 @@ Const
   
   INVALID_SOCKET = -1;
   SOCKET_ERROR = -1;
+  
+     TCP_NODELAY = $01;
+  { set maximum segment size  }
+     TCP_MAXSEG = $02;
+  { don't push last block of write  }
+     TCP_NOPUSH = $04;
+  { don't use TCP options  }
+     TCP_NOOPT = $08;
+  { use MD5 digests (RFC2385)  }
+     TCP_MD5SIG = $10;
+  { retrieve tcp_info structure  }
+     TCP_INFO = $20;
+
+

+ 39 - 0
rtl/linux/unxsockh.inc

@@ -303,4 +303,43 @@ Const
   MSG_NOSIGNAL = $4000;              { Do not generate SIGPIPE }
   MSG_MORE     = $8000;              { Sender will send more }
   MSG_EOF      = MSG_FIN;
+  
+     TCP_NODELAY = 1;
+  { Limit MSS  }
+     TCP_MAXSEG = 2;
+  { Never send partially complete segments  }
+     TCP_CORK = 3;
+  { Start keeplives after this period  }
+     TCP_KEEPIDLE = 4;
+  { Interval between keepalives  }
+     TCP_KEEPINTVL = 5;
+  { Number of keepalives before death  }
+     TCP_KEEPCNT = 6;
+  { Number of SYN retransmits  }
+     TCP_SYNCNT = 7;
+  { Life time of orphaned FIN-WAIT-2 state  }
+     TCP_LINGER2 = 8;
+  { Wake up listener only when data arrive  }
+     TCP_DEFER_ACCEPT = 9;
+  { Bound advertised window  }
+     TCP_WINDOW_CLAMP = 10;
+  { Information about this connection.  }
+     TCP_INFO = 11;
+  { Block/reenable quick acks  }
+     TCP_QUICKACK = 12;
+  { Congestion control algorithm  }
+     TCP_CONGESTION = 13;
+  { TCP MD5 Signature (RFC2385)  }
+     TCP_MD5SIG = 14;
+  
+     UDP_CORK = 1;
+  { Set the socket to accept encapsulated packets  }
+     UDP_ENCAP = 100;
+  { UDP encapsulation types  }
+  { draft-ietf-ipsec-nat-t-ike-00/01  }
+     UDP_ENCAP_ESPINUDP_NON_IKE = 1;
+  { draft-ietf-ipsec-udp-encaps-06  }
+     UDP_ENCAP_ESPINUDP = 2;
+  { rfc2661  }
+     UDP_ENCAP_L2TPINUDP = 3;
 

+ 27 - 0
rtl/netbsd/unxsockh.inc

@@ -368,4 +368,31 @@ Const
   MSG_COMPAT    = $8000;
   MSG_SOCALLBCK = $10000;
   MSG_NOSIGNAL  = $20000;              { Do not generate SIGPIPE }
+  
+     TCP_NODELAY = 1;
+  { set maximum segment size  }
+     TCP_MAXSEG = 2;
+     TCP_KEEPIDLE = 3;
+  { reserved for FreeBSD compat  }
+     TCP_NOPUSH = 4;
+     TCP_KEEPINTVL = 5;
+     TCP_KEEPCNT = 6;
+     TCP_KEEPINIT = 7;
+  { reserved for FreeBSD compat  }
+     TCP_NOOPT = 8;
+  { use MD5 digests (RFC2385)  }
+     TCP_MD5SIG = $10;
+  { selected congestion control  }
+     TCP_CONGCTL = $20;
+  { socket options for UDP  }
+     UDP_ENCAP = 100;
+  { Encapsulation types  }
+  { draft-ietf-ipsec-nat-t-ike-00/01  }
+     UDP_ENCAP_ESPINUDP_NON_IKE = 1;
+  { draft-ietf-ipsec-udp-encaps-06  }
+     UDP_ENCAP_ESPINUDP = 2;
+  { Default encapsulation port  }
+     UDP_ENCAP_ESPINUDP_PORT = 500;
+  { Maximum UDP fragment size for ESP over UDP  }
+     UDP_ENCAP_ESPINUDP_MAXFRAGLEN = 552;
 

+ 4 - 4
rtl/objpas/math.pp

@@ -313,8 +313,8 @@ function power(base,exponent : float) : float;
 { base^exponent }
 function intpower(base : float;const exponent : Integer) : float;
 
-operator ** (bas,expo : float) e: float;
-operator ** (bas,expo : int64) i: int64;
+operator ** (bas,expo : float) e: float; inline;
+operator ** (bas,expo : int64) i: int64; inline;
 
 { number converting }
 
@@ -908,13 +908,13 @@ function intpower(base : float;const exponent : Integer) : float;
   end;
 
 
-operator ** (bas,expo : float) e: float;
+operator ** (bas,expo : float) e: float; inline;
   begin
     e:=power(bas,expo);
   end;
 
 
-operator ** (bas,expo : int64) i: int64;
+operator ** (bas,expo : int64) i: int64; inline;
   begin
     i:=round(intpower(bas,expo));
   end;

+ 28 - 0
rtl/openbsd/unxsockh.inc

@@ -118,6 +118,34 @@ const
      PF_BPF = pseudo_AF_HDRCMPLT;
      PF_BLUETOOTH = AF_BLUETOOTH;
      PF_MAX = AF_MAX;
+     
+     MSG_OOB = $1;
+  { peek at incoming message  }
+     MSG_PEEK = $2;
+  { send without using routing tables  }
+     MSG_DONTROUTE = $4;
+  { data completes record  }
+     MSG_EOR = $8;
+  { data discarded before delivery  }
+     MSG_TRUNC = $10;
+  { control data lost before delivery  }
+     MSG_CTRUNC = $20;
+  { wait for full request or error  }
+     MSG_WAITALL = $40;
+  { this message should be nonblocking  }
+     MSG_DONTWAIT = $80;
+  { this message rec'd as broadcast  }
+     MSG_BCAST = $100;
+  { this message rec'd as multicast  }
+     MSG_MCAST = $200;
+     
+     TCP_NODELAY = $01;
+  { set maximum segment size  }
+     TCP_MAXSEG = $02;
+  { enable TCP MD5 signature option  }
+     TCP_MD5SIG = $04;
+  { enable SACKs (if disabled by def.)  }
+     TCP_SACK_ENABLE = $08;
 
         SHUT_RD         =0;             { shut down the reading side }
         SHUT_WR         =1;             { shut down the writing side }

+ 15 - 0
rtl/solaris/unxsockh.inc

@@ -167,4 +167,19 @@ const
   MSG_NOTIFICATION = $0100;           { Notification, not data }
   MSG_XPG4_2       = $8000;	      { Private: XPG4.2 flag }
   MSG_MAXIOVLEN    =    16;
+  
+     TCP_NODELAY = $01;
+  { set maximum segment size  }
+     TCP_MAXSEG = $02;
+  { set keepalive timer  }
+     TCP_KEEPALIVE = $8;
+     TCP_NOTIFY_THRESHOLD = $10;
+     TCP_ABORT_THRESHOLD = $11;
+     TCP_CONN_NOTIFY_THRESHOLD = $12;
+     TCP_CONN_ABORT_THRESHOLD = $13;
+     TCP_RECVDSTADDR = $14;
+     TCP_INIT_CWND = $15;
+     TCP_KEEPALIVE_THRESHOLD = $16;
+     TCP_KEEPALIVE_ABORT_THRESHOLD = $17;
+     TCP_CORK = $18;