summaryrefslogtreecommitdiff
path: root/inputmethod/mozc-server/patches/patch-base_clock.cc
blob: d9070f8614ae66150923bc5eef2086104bd3a03e (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
$NetBSD: patch-base_clock.cc,v 1.3 2021/02/15 14:50:23 ryoon Exp $

* NetBSD support

--- base/clock.cc.orig	2021-02-15 03:48:53.000000000 +0000
+++ base/clock.cc
@@ -116,7 +116,7 @@ class ClockImpl : public ClockInterface 
     mach_timebase_info(&timebase_info);
     return static_cast<uint64>(1.0e9 * timebase_info.denom /
                                timebase_info.numer);
-#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM)
+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM) || defined(OS_NETBSD)
     return 1000000uLL;
 #else  // platforms (OS_WIN, __APPLE__, OS_LINUX, ...)
 #error "Not supported platform"
@@ -133,7 +133,7 @@ class ClockImpl : public ClockInterface 
     return static_cast<uint64>(timestamp.QuadPart);
 #elif defined(__APPLE__)
     return static_cast<uint64>(mach_absolute_time());
-#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM)
+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WASM) || defined(OS_NETBSD)
     uint64 sec;
     uint32 usec;
     GetTimeOfDay(&sec, &usec);