7
mirror of https://github.com/EEVengers/ThunderScope.git synced 2025-04-22 17:43:44 +00:00

make everything build on windows

This commit is contained in:
Fredrik Hubinette 2022-02-17 19:29:35 -08:00
parent 15c95b43bb
commit 0b7e068b1e
4 changed files with 12 additions and 12 deletions
Software/libthunderscopehw
examples
thunderscopehwbench
thunderscopehwcalibrate
thunderscopehwdump
library

View File

@ -4,8 +4,11 @@
#include <stdlib.h>
#include <inttypes.h>
#include <string.h>
#include <time.h>
#ifndef WIN32
#ifdef WIN32
#include <windows.h>
#else
#include <unistd.h>
#include <sys/time.h>
#endif
@ -13,19 +16,13 @@
static uint64_t time_ns(void)
{
#ifdef WIN32
struct timespec tv;
struct timespec ts;
if (timespec_get(&ts, TIME_UTC) != TIME_UTC)
{
fprintf(stderr, "timespec_get failed!");
exit(1);
}
return 1000000000 * ts.tv_sec + ts.tv_nsec;
#else
struct timeval tv;
gettimeofday(&tv, NULL);
return 1000000000 * tv.tv_sec + tv.tv_usec * 1000;
#endif
}
struct Option {

View File

@ -5,7 +5,9 @@
#include <inttypes.h>
#include <string.h>
#ifndef WIN32
#ifdef WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif

View File

@ -5,7 +5,9 @@
#include <inttypes.h>
#include <string.h>
#ifndef WIN32
#ifdef WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif

View File

@ -2,8 +2,7 @@
#include "thunderscopehw_private.h"
#ifdef WIN32
#else
#ifndef WIN32
#include <unistd.h>
#endif