From 979533c39ad690eccd14b5d03f92f32b3186cda1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Juho=20V=C3=A4h=C3=A4-Herttua?= Date: Thu, 15 Mar 2012 20:09:21 +0200 Subject: [PATCH] Several smaller fixes to compile on windows --- src/lib/compat.h | 2 +- src/lib/crypto/os_port.h | 4 +--- src/lib/logger.c | 1 + src/lib/raop_rtp.c | 2 -- src/test/example.c | 8 ++++++++ 5 files changed, 11 insertions(+), 6 deletions(-) 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); -- 2.34.1