summary | 
shortlog | 
log | 
commit | commitdiff | 
tree
raw | 
patch | 
inline | side by side (from parent 1: 
ac385c7)
 
 function unixtimefloat:float;\r
 var\r
   tv:ttimeval;\r
 function unixtimefloat:float;\r
 var\r
   tv:ttimeval;\r
 begin\r
   gettimeofday(tv);\r
 begin\r
   gettimeofday(tv);\r
-  result := tv.tv_sec+(tv.tv_usec/1000000);\r
+  sec := tv.tv_sec;\r
+  {$ifndef cpu64}\r
+  if (sec < 0) then inc(sec,$100000000); //tv_sec is 32 bits\r
+  {$endif}\r
+  result := sec+(tv.tv_usec/1000000);\r
 end;\r
 \r
 {$ifdef linux}\r
 end;\r
 \r
 {$ifdef linux}\r
 function unixtimeint:tunixtimeint;\r
 var\r
   tv:ttimeval;\r
 function unixtimeint:tunixtimeint;\r
 var\r
   tv:ttimeval;\r
 begin\r
   gettimeofday(tv);\r
 begin\r
   gettimeofday(tv);\r
+  sec := tv.tv_sec;\r
+  {$ifndef cpu64}\r
+  if (sec < 0) then inc(sec,$100000000); //tv_sec is 32 bits\r
+  {$endif}\r
+  result := sec;\r
 end;\r
 \r
 {------------------------------ end of *nix/freepascal section}\r
 end;\r
 \r
 {------------------------------ end of *nix/freepascal section}\r