Add CYGWIN flag check to be recognised as Posix-enough (?)
This commit is contained in:
@@ -474,7 +474,7 @@ double vol2attn(double vol, long max_db, long min_db) {
|
||||
|
||||
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);
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
#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
|
||||
|
||||
@@ -675,7 +675,7 @@ static abuf_t *buffer_get_frame(void) {
|
||||
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;
|
||||
@@ -1307,7 +1307,7 @@ int player_play(stream_cfg *stream) {
|
||||
#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.
|
||||
|
||||
Reference in New Issue
Block a user