]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Add CYGWIN flag check to be recognised as Posix-enough (?)
authorMke Brady <mikebrady@eircom.net>
Wed, 21 Oct 2015 09:22:56 +0000 (10:22 +0100)
committerMke Brady <mikebrady@eircom.net>
Wed, 21 Oct 2015 09:22:56 +0000 (10:22 +0100)
common.c
common.h
player.c

index bb6dafa2e3408b2a0112a409f13846af6a5fedd4..f39c746b0d06def7d0f2a1039ec5c4058d9ec522 100644 (file)
--- a/common.c
+++ b/common.c
@@ -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);
index ef3f84b3dea703029a07f49b21c8e52458c3bfbf..16c3c0e95fb693f330eec0f9d67ffa58301a2476 100644 (file)
--- a/common.h
+++ b/common.h
@@ -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
index 52a93f5f0953b22bb256495ca885ed8747d840a2..92ebedf9c5b64576c23984a5a4c668714fe84825 100644 (file)
--- a/player.c
+++ b/player.c
@@ -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.