summaryrefslogtreecommitdiff
path: root/lang/intel-compute-runtime/files/patch-clock_gettime
blob: 34ada0f4b451b2bd98f65e9b1d3a3878161d29d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
CLOCK_MONOTONIC_RAW doesn't exist on non-Linux systems.

runtime/os_interface/linux/os_time_linux.cpp:61:21: error:
      use of undeclared identifier 'CLOCK_MONOTONIC_RAW'
    if (getTimeFunc(CLOCK_MONOTONIC_RAW, &ts)) {
                    ^
runtime/os_interface/linux/os_time_linux.cpp:138:24: error:
      use of undeclared identifier 'CLOCK_MONOTONIC_RAW'
    if (resolutionFunc(CLOCK_MONOTONIC_RAW, &ts)) {
                       ^

--- shared/source/os_interface/linux/os_time_linux.cpp.orig	2020-02-28 16:16:42 UTC
+++ shared/source/os_interface/linux/os_time_linux.cpp
@@ -14,6 +14,10 @@
 
 #include <time.h>
 
+#ifndef CLOCK_MONOTONIC_RAW
+#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
+#endif
+
 namespace NEO {
 
 OSTimeLinux::OSTimeLinux(OSInterface *osInterface) {