From: Juho Vähä-Herttua Date: Thu, 15 Mar 2012 18:09:21 +0000 (+0200) Subject: Several smaller fixes to compile on windows X-Git-Tag: upstream/0.9.0~4^2~110 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=979533c39ad690eccd14b5d03f92f32b3186cda1;p=deb_shairplay.git Several smaller fixes to compile on windows --- diff --git a/src/lib/compat.h b/src/lib/compat.h index 560e6cd..ab32385 100644 --- a/src/lib/compat.h +++ b/src/lib/compat.h @@ -16,8 +16,8 @@ #define COMPAT_H #if defined(WIN32) -#include #include +#include #else #include #include diff --git a/src/lib/crypto/os_port.h b/src/lib/crypto/os_port.h index 80c09e8..cd505b5 100644 --- a/src/lib/crypto/os_port.h +++ b/src/lib/crypto/os_port.h @@ -97,7 +97,6 @@ extern "C" { #define strdup(A) _strdup(A) #define chroot(A) _chdir(A) #define chdir(A) _chdir(A) -#define alloca(A) _alloca(A) #ifndef lseek #define lseek(A,B,C) _lseek(A,B,C) #endif @@ -108,7 +107,7 @@ extern "C" { see http://www.khngai.com/emacs/tty.php */ #define TTY_FLUSH() if (!_isatty(_fileno(stdout))) fflush(stdout); -/* + typedef UINT8 uint8_t; typedef INT8 int8_t; typedef UINT16 uint16_t; @@ -118,7 +117,6 @@ typedef INT32 int32_t; typedef UINT64 uint64_t; typedef INT64 int64_t; typedef int socklen_t; -*/ #else /* Not Win32 */ diff --git a/src/lib/logger.c b/src/lib/logger.c index b344f4e..c4d88ee 100644 --- a/src/lib/logger.c +++ b/src/lib/logger.c @@ -18,6 +18,7 @@ #include #include "logger.h" +#include "compat.h" void logger_init(logger_t *logger) diff --git a/src/lib/raop_rtp.c b/src/lib/raop_rtp.c index 39ac7ab..3287346 100644 --- a/src/lib/raop_rtp.c +++ b/src/lib/raop_rtp.c @@ -379,7 +379,6 @@ raop_rtp_thread_tcp(void *arg) } if (stream_fd != -1 && FD_ISSET(stream_fd, &rfds)) { unsigned int rtplen=0; - char type; const void *audiobuf; int audiobuflen; @@ -415,7 +414,6 @@ raop_rtp_thread_tcp(void *arg) } /* Packet is valid, process it */ - type = packet[4+1] & ~0x80; ret = raop_buffer_queue(raop_rtp->buffer, packet+4, rtplen, 0); assert(ret >= 0); diff --git a/src/test/example.c b/src/test/example.c index 999bb6b..98c6fcd 100644 --- a/src/test/example.c +++ b/src/test/example.c @@ -2,6 +2,10 @@ #include #include +#ifdef WIN32 +#include +#endif + #include "dnssd.h" #include "raop.h" @@ -62,7 +66,11 @@ main(int argc, char *argv[]) dnssd = dnssd_init(hwaddr, sizeof(hwaddr), NULL); dnssd_register_raop(dnssd, name, raop_port); +#ifndef WIN32 sleep(100); +#else + Sleep(100*1000); +#endif dnssd_unregister_raop(dnssd); dnssd_destroy(dnssd);