Should fix #759 except on OSX versions below 10.12, which don't
have clock_gettime.
#include <termios.h>
#include <sys/ioctl.h>
#include <sys/time.h>
+#include <time.h>
#include <poll.h>
#endif
#ifdef __APPLE__
static void get_time(struct timeval *time)
{
+#ifdef HAVE_CLOCK_GETTIME
+ struct timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ time->tv_sec = ts.tv_sec;
+ time->tv_usec = ts.tv_nsec / 1000;
+#else
gettimeofday(time, NULL);
+#endif
}
SP_API enum sp_return sp_get_port_by_name(const char *portname, struct sp_port **port_ptr)