From 9e91e8afc9570b5264d00bee50dcd53a7f6f4630 Mon Sep 17 00:00:00 2001 From: "Joshua M. Doe" Date: Fri, 19 Nov 2021 12:44:02 -0500 Subject: [PATCH] gentlsrc: fix compiling on Linux This plugin still needs a major refactor, and currently requires modifications to support any Linux GenTL producers, at least the CTI path. --- common/get_unix_ns.h | 21 +++++++++++++++++++++ sys/gentl/gstgentlsrc.c | 3 --- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/common/get_unix_ns.h b/common/get_unix_ns.h index 721b942..6fb6cec 100644 --- a/common/get_unix_ns.h +++ b/common/get_unix_ns.h @@ -3,6 +3,13 @@ #include +#ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#endif + + +#ifdef _WIN32 typedef struct _MYFILETIME { guint32 dwLowDateTime; @@ -39,5 +46,19 @@ get_unix_ns () ltime.QuadPart -= 11644473600000 * 10000; return ltime.QuadPart * 100; } +#endif /* _WIN32 */ + + +#ifdef __unix__ +static guint64 +get_unix_ns () +{ + struct timespec spec; + + clock_gettime (CLOCK_REALTIME, &spec); + return (guint64) spec.tv_sec * 1000000000L + (guint64) spec.tv_nsec; +} +#endif /* __unix__ */ + #endif /* _GET_UNIX_NS_H_ */ diff --git a/sys/gentl/gstgentlsrc.c b/sys/gentl/gstgentlsrc.c index 7bc657c..259d2dc 100644 --- a/sys/gentl/gstgentlsrc.c +++ b/sys/gentl/gstgentlsrc.c @@ -34,9 +34,6 @@ #include "config.h" #endif -#define WIN32_LEAN_AND_MEAN -#include - #include #include