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