blob: b68ece902cf0b35b6a0b126ce183402510d985d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
$NetBSD: patch-ab,v 1.4 2016/12/03 09:06:37 maya Exp $
Avoid ancient function that needs libcompat.
include sys/time.h for gettimeofday (needed by linux)
--- zlibrary/core/src/unix/time/ZLUnixTime.cpp.orig 2012-11-30 12:41:25.000000000 +0000
+++ zlibrary/core/src/unix/time/ZLUnixTime.cpp
@@ -17,17 +17,17 @@
* 02110-1301, USA.
*/
-#include <sys/timeb.h>
#include <time.h>
+#include <sys/time.h>
#include <ZLTime.h>
#include "ZLUnixTime.h"
ZLTime ZLUnixTimeManager::currentTime() const {
- struct timeb timeB;
- ftime(&timeB);
- return ZLTime((long)timeB.time, timeB.millitm);
+ struct timeval timeB;
+ gettimeofday(&timeB,NULL);
+ return ZLTime(timeB.tv_sec, timeB.tv_usec/1000);
}
short ZLUnixTimeManager::hoursBySeconds(long seconds) const {
|