X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/ac55319310f2e0b8ac5d848c1591b5e72d49c9b3..64005e4a670ae074eea1980c5eca131748884ec0:/ltimevalstuff.pas?ds=sidebyside diff --git a/ltimevalstuff.pas b/ltimevalstuff.pas old mode 100755 new mode 100644 index df0342c..7054ea9 --- a/ltimevalstuff.pas +++ b/ltimevalstuff.pas @@ -3,10 +3,14 @@ which is included in the package ----------------------------------------------------------------------------- } +{$ifdef fpc} + {$mode delphi} +{$endif} + unit ltimevalstuff; interface -{$ifdef win32} +{$ifdef mswindows} type ttimeval = record tv_sec : longint; @@ -16,14 +20,14 @@ interface {$ifdef ver1_0} uses linux; {$else} - uses baseunix,unix,unixutil; + uses baseunix,unix,unixutil,sockets; {$endif} {$endif} procedure tv_add(var tv:ttimeval;msec:integer); function tv_compare(const tv1,tv2:ttimeval):boolean; -procedure tv_substract(var tv:ttimeval;const tv2:ttimeval); +procedure tv_subtract(var tv:ttimeval;const tv2:ttimeval); procedure msectotimeval(var tv:ttimeval;msec:integer); //tv_invalidtimebig will always compare as greater than any valid timeval @@ -55,7 +59,7 @@ begin end else result := tv1.tv_sec > tv2.tv_sec; end; -procedure tv_substract(var tv:ttimeval;const tv2:ttimeval); +procedure tv_subtract(var tv:ttimeval;const tv2:ttimeval); begin dec(tv.tv_usec,tv2.tv_usec); if tv.tv_usec < 0 then begin