Several smaller fixes to compile on windows
[deb_shairplay.git] / src / test / example.c
index 15f91f620c923e74449ac920eda3c4a013da3f72..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"
 
@@ -56,13 +60,17 @@ main(int argc, char *argv[])
        raop_cbs.audio_flush = audio_flush;
        raop_cbs.audio_destroy = audio_destroy;
 
-       raop = raop_init_from_keyfile(&raop_cbs, "airport.key", hwaddr, sizeof(hwaddr));
-       raop_start(raop, &raop_port);
+       raop = raop_init_from_keyfile(&raop_cbs, "airport.key");
+       raop_start(raop, &raop_port, hwaddr, sizeof(hwaddr));
 
        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);