--- libs\libmythhdhomerun\hdhomerun_os_windows.h~~	2010-02-03 12:29:10 -0600
+++ libs\libmythhdhomerun\hdhomerun_os_windows.h	2010-02-03 12:25:33 -0600
@@ -31,10 +31,16 @@
  */
 
 #define _WINSOCKAPI_
+#if defined(USING_MINGW)
+/* MinGW lacks wspiapi.h; set minimum WINVER to WinXP to remove dependency */
+#define WINVER 0x0501
+#endif
 #include <windows.h>
 #include <winsock2.h>
 #include <ws2tcpip.h>
+#if !defined(USING_MINGW)
 #include <wspiapi.h>
+#endif
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdarg.h>
@@ -53,6 +59,10 @@
 #endif
 
 typedef int bool_t;
+#if defined(USING_MINGW)
+#include <stdint.h>
+#include <pthread.h>
+#else
 typedef signed __int8 int8_t;
 typedef signed __int16 int16_t;
 typedef signed __int32 int32_t;
@@ -63,6 +73,7 @@
 typedef unsigned __int64 uint64_t;
 typedef HANDLE pthread_t;
 typedef HANDLE pthread_mutex_t;
+#endif
 
 #define va_copy(x, y) x = y
 #define atoll _atoi64
@@ -82,11 +93,13 @@
 extern LIBTYPE void msleep_approx(uint64_t ms);
 extern LIBTYPE void msleep_minimum(uint64_t ms);
 
+#if !defined(PTHREAD_H)
 extern LIBTYPE int pthread_create(pthread_t *tid, void *attr, LPTHREAD_START_ROUTINE start, void *arg);
 extern LIBTYPE int pthread_join(pthread_t tid, void **value_ptr);
 extern LIBTYPE void pthread_mutex_init(pthread_mutex_t *mutex, void *attr);
 extern LIBTYPE void pthread_mutex_lock(pthread_mutex_t *mutex);
 extern LIBTYPE void pthread_mutex_unlock(pthread_mutex_t *mutex);
+#endif
 
 /*
  * The console output format should be set to UTF-8, however in XP and Vista this breaks batch file processing.
--- libs\libmythhdhomerun\hdhomerun_os_windows.c~~	2010-02-03 12:29:06 -0600
+++ libs\libmythhdhomerun\hdhomerun_os_windows.c	2010-02-03 11:49:04 -0600
@@ -76,6 +76,7 @@
 	}
 }
 
+#if !defined(PTHREAD_H)
 int pthread_create(pthread_t *tid, void *attr, LPTHREAD_START_ROUTINE start, void *arg)
 {
 	*tid = CreateThread(NULL, 0, start, arg, 0, NULL);
@@ -112,6 +113,7 @@
 {
 	ReleaseMutex(*mutex);
 }
+#endif
 
 /*
  * The console output format should be set to UTF-8, however in XP and Vista this breaks batch file processing.
--- libs\libmythhdhomerun\libmythhdhomerun.pro~~	2010-02-03 12:29:10 -0600
+++ libs\libmythhdhomerun\libmythhdhomerun.pro	2010-02-03 11:29:55 -0600
@@ -32,6 +32,7 @@
 mingw {
     HEADERS += hdhomerun_os_windows.h
     SOURCES += hdhomerun_os_windows.c
+    SOURCES -= hdhomerun_os_posix.c
     SOURCES += hdhomerun_sock_windows.c
     LIBS += -lws2_32 -liphlpapi -lpthread
 }
