uint64_t get_absolute_time_in_fp() {
uint64_t time_now_fp;
-#ifdef COMPILE_FOR_LINUX_AND_FREEBSD
+#ifdef COMPILE_FOR_LINUX_AND_FREEBSD_AND_CYGWIN
struct timespec tn;
// can't use CLOCK_MONOTONIC_RAW as it's not implemented in OpenWrt
clock_gettime(CLOCK_MONOTONIC, &tn);
#endif
#endif
-#if defined(__linux__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__CYGWIN__)
/* Linux and FreeBSD */
-#define COMPILE_FOR_LINUX_AND_FREEBSD 1
+#define COMPILE_FOR_LINUX_AND_FREEBSD_AND_CYGWIN 1
#endif
// struct sockaddr_in6 is bigger than struct sockaddr. derp
time_to_wait_for_wakeup_fp *= 4 * 352; // four full 352-frame packets
time_to_wait_for_wakeup_fp /= 3; // four thirds of a packet time
-#ifdef COMPILE_FOR_LINUX_AND_FREEBSD
+#ifdef COMPILE_FOR_LINUX_AND_FREEBSD_AND_CYGWIN
uint64_t time_of_wakeup_fp = local_time_now + time_to_wait_for_wakeup_fp;
uint64_t sec = time_of_wakeup_fp >> 32;
uint64_t nsec = ((time_of_wakeup_fp & 0xffffffff) * 1000000000) >> 32;
#endif
// set the flowcontrol condition variable to wait on a monotonic clock
-#ifdef COMPILE_FOR_LINUX_AND_FREEBSD
+#ifdef COMPILE_FOR_LINUX_AND_FREEBSD_AND_CYGWIN
pthread_condattr_t attr;
pthread_condattr_init(&attr);
pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); // can't do this in OS X, and don't need it.