Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/cad/graywolf/files/patch-src_Ylib_timer.c
16461 views
1
--- src/Ylib/timer.c.orig 2018-08-23 20:02:57 UTC
2
+++ src/Ylib/timer.c
3
@@ -58,6 +58,23 @@ REVISIONS:
4
#include <sys/timeb.h>
5
#endif /* SYS5 */
6
7
+#include <sys/time.h>
8
+
9
+// from /usr/src/lib/libcompat/4.1/ftime.c
10
+int ftime(struct timeb *tbp) {
11
+ struct timezone tz;
12
+ struct timeval t;
13
+
14
+ if (gettimeofday(&t, &tz) < 0)
15
+ return (-1);
16
+ tbp->millitm = t.tv_usec / 1000;
17
+ tbp->time = t.tv_sec;
18
+ tbp->timezone = tz.tz_minuteswest;
19
+ tbp->dstflag = tz.tz_dsttime;
20
+
21
+ return (0);
22
+}
23
+
24
static INT base_timeS = 0 ; /* the time in seconds at the start */
25
static INT milli_timeS ; /* the millisecond part of the start */
26
/* initialize the timer */
27
28