X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/0ac6b47e810e6efaebcdbf3075b633e9b4109341..250fdcdbf77f0296f31391eb3a8b87de195aad92:/ltimevalstuff.pas?ds=sidebyside diff --git a/ltimevalstuff.pas b/ltimevalstuff.pas index bf9767e..93f84bb 100755 --- a/ltimevalstuff.pas +++ b/ltimevalstuff.pas @@ -3,41 +3,45 @@ which is included in the package ----------------------------------------------------------------------------- } +{$ifdef fpc} + {$mode delphi} +{$endif} + unit ltimevalstuff; interface - -{$ifdef win32} - type - ttimeval = record - tv_sec : longint; - tv_usec : longint; - end; -{$else} - {$ifdef ver1_0} - uses linux; - {$else} - uses baseunix,unix; - {$endif} -{$endif} - + +{$ifdef win32} + type + ttimeval = record + tv_sec : longint; + tv_usec : longint; + end; +{$else} + {$ifdef ver1_0} + uses linux; + {$else} + 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 msectotimeval(var tv:ttimeval;msec:integer); - + //tv_invalidtimebig will always compare as greater than any valid timeval -//unfortunately unixstuff.inc hasn't worked it's magic yet so we +//unfortunately unixstuff.inc hasn't worked it's magic yet so we //have to ifdef this manually. const - {$ifdef ver1_0} + {$ifdef ver1_0} tv_invalidtimebig : ttimeval = (sec:maxlongint;usec:maxlongint); - {$else} - tv_invalidtimebig : ttimeval = (tv_sec:maxlongint;tv_usec:maxlongint); - {$endif} + {$else} + tv_invalidtimebig : ttimeval = (tv_sec:maxlongint;tv_usec:maxlongint); + {$endif} implementation - -{$i unixstuff.inc} + +{$i unixstuff.inc} {add nn msec to tv} procedure tv_add(var tv:ttimeval;msec:integer);