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:
parent
15c95b43bb
commit
0b7e068b1e
Software/libthunderscopehw
examples
thunderscopehwbench
thunderscopehwcalibrate
thunderscopehwdump
library
@ -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 {
|
||||
|
@ -5,7 +5,9 @@
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef WIN32
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
@ -5,7 +5,9 @@
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef WIN32
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
@ -2,8 +2,7 @@
|
||||
|
||||
#include "thunderscopehw_private.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#else
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user