summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWander Lairson Costa <wander.lairson@gmail.com>2020-06-23 20:20:14 +0000
committerStefan Schmidt <s.schmidt@samsung.com>2020-08-20 09:36:23 +0200
commit1ee6e020bb623e91df9c10a161efd01ba2a45603 (patch)
treeebf50d13fcc2333144f8d32b4d3b2a50024bb186 /src
parentbfc3e9f96ec3089545bcd67c3c2a4c9e9c4f405f (diff)
downloadefl-1ee6e020bb623e91df9c10a161efd01ba2a45603.tar.gz
eina_test_lock.c: Implement clock_gettime for Windows
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Reviewed-by: Vincent Torri <vincent.torri@gmail.com> Differential Revision: https://phab.enlightenment.org/D12023
Diffstat (limited to 'src')
-rw-r--r--src/tests/eina/eina_test_lock.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/tests/eina/eina_test_lock.c b/src/tests/eina/eina_test_lock.c
index 583ca1a7a9..bbf036b203 100644
--- a/src/tests/eina/eina_test_lock.c
+++ b/src/tests/eina/eina_test_lock.c
@@ -53,6 +53,25 @@ clock_gettime(int mode, struct timespec* ts)
return 0;
}
+
+# elif defined(_WIN32)
+
+# define CLOCK_REALTIME 0
+
+int
+clock_gettime(int mode, struct timespec* ts)
+{
+ FILETIME sys_time;
+ ULARGE_INTEGER li_sys_time;
+
+ GetSystemTimeAsFileTime(&sys_time);
+ li_sys_time.u.LowPart = sys_time.dwLowDateTime;
+ li_sys_time.u.HighPart = sys_time.dwHighDateTime;
+ ts->tv_sec = li_sys_time.QuadPart / 10000000UL;
+ ts->tv_nsec = (li_sys_time.QuadPart % 10000000UL) * 100UL;
+ return 0;
+}
+
# else /* ! __MACH__ */
# error No support for clock_gettime()
# endif /* __MACH__ */