27 lines
703 B
Text
27 lines
703 B
Text
$NetBSD: patch-ab,v 1.3 2012/10/01 12:47:30 wiz Exp $
|
|
|
|
Avoid ancient function that needs libcompat.
|
|
|
|
--- zlibrary/core/src/unix/time/ZLUnixTime.cpp.orig 2012-09-06 20:58:48.000000000 +0000
|
|
+++ zlibrary/core/src/unix/time/ZLUnixTime.cpp
|
|
@@ -17,7 +17,6 @@
|
|
* 02110-1301, USA.
|
|
*/
|
|
|
|
-#include <sys/timeb.h>
|
|
#include <time.h>
|
|
|
|
#include <ZLTime.h>
|
|
@@ -25,9 +24,9 @@
|
|
#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 {
|