Several smaller fixes to compile on windows
authorJuho Vähä-Herttua <juhovh@iki.fi>
Thu, 15 Mar 2012 18:09:21 +0000 (20:09 +0200)
committerJuho Vähä-Herttua <juhovh@iki.fi>
Wed, 16 May 2012 21:33:31 +0000 (00:33 +0300)
src/lib/compat.h
src/lib/crypto/os_port.h
src/lib/logger.c
src/lib/raop_rtp.c
src/test/example.c

index 560e6cd04ed0bc26347500b52d9ab860a8915594..ab32385f784f07ddcb0226b2ab8d3d08cba92600 100644 (file)
@@ -16,8 +16,8 @@
 #define COMPAT_H
 
 #if defined(WIN32)
-#include <windows.h>
 #include <ws2tcpip.h>
+#include <windows.h>
 #else
 #include <sys/types.h>
 #include <sys/socket.h>
index 80c09e840d9ba69bc570c80f7b8ea509e3582c4e..cd505b588b655604e34d9b70f0a49c90c10f73b6 100644 (file)
@@ -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 */
 
index b344f4e985e891b7bdd00f1b7cfab91b2ab787f2..c4d88eeb11a9e3634efc96fb687213ca2c586648 100644 (file)
@@ -18,6 +18,7 @@
 #include <assert.h>
 
 #include "logger.h"
+#include "compat.h"
 
 void
 logger_init(logger_t *logger)
index 39ac7ab53d2d7c9f13b2ef0b10028e2b868bf275..32873464b1717a211701304daaa6ec149a0ad99b 100644 (file)
@@ -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);
 
index 999bb6b0c4b1500cb39e09b452851a5d674e0f95..98c6fcd66f5ac5b213e7c6bab4eb8dff5e2b0bb9 100644 (file)
@@ -2,6 +2,10 @@
 #include <stdio.h>
 #include <unistd.h>
 
+#ifdef WIN32
+#include <windows.h>
+#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);