opnsense-ports/math/lp_solve/files/patch-shared+commonlib.c
Franco Fichtner 8cb1a96ede ports: pull in a snapshot of the FreeBSD ports tree
Taken from:	https://github.com/freebsd/freebsd-ports.git
Commit id:	5070672073b68be364139bc6b3a89100bd17d331
2014-11-09 14:03:21 +01:00

27 lines
601 B
C

--- shared/commonlib.c.orig Sat Mar 18 07:16:42 2006
+++ shared/commonlib.c Sat Sep 2 21:01:39 2006
@@ -4,7 +4,7 @@
#ifdef INTEGERTIME
# include <time.h>
#else
-# include <sys/timeb.h>
+# include <sys/time.h>
#endif
#include <stdlib.h>
@@ -673,10 +673,12 @@
#elif defined CLOCKTIME
return((double)clock()/CLOCKS_PER_SEC /* CLK_TCK */);
#else
- struct timeb buf;
+ struct timeval tv;
+ struct timezone tz;
+
+ gettimeofday(&tv, &tz);
+ return((double)tv.tv_sec+((double)tv.tv_usec)/1000000.0);
- ftime(&buf);
- return((double)buf.time+((double) buf.millitm)/1000.0);
#endif
}