Ticket #7970: 7970-hdhr_mingw.patch
File 7970-hdhr_mingw.patch, 2.4 KB (added by , 14 years ago) |
---|
-
libs\libmythhdhomerun\hdhomerun_os_windows.h
old new 31 31 */ 32 32 33 33 #define _WINSOCKAPI_ 34 #if defined(USING_MINGW) 35 /* MinGW lacks wspiapi.h; set minimum WINVER to WinXP to remove dependency */ 36 #define WINVER 0x0501 37 #endif 34 38 #include <windows.h> 35 39 #include <winsock2.h> 36 40 #include <ws2tcpip.h> 41 #if !defined(USING_MINGW) 37 42 #include <wspiapi.h> 43 #endif 38 44 #include <stdlib.h> 39 45 #include <stdio.h> 40 46 #include <stdarg.h> … … 53 59 #endif 54 60 55 61 typedef int bool_t; 62 #if defined(USING_MINGW) 63 #include <stdint.h> 64 #include <pthread.h> 65 #else 56 66 typedef signed __int8 int8_t; 57 67 typedef signed __int16 int16_t; 58 68 typedef signed __int32 int32_t; … … 63 73 typedef unsigned __int64 uint64_t; 64 74 typedef HANDLE pthread_t; 65 75 typedef HANDLE pthread_mutex_t; 76 #endif 66 77 67 78 #define va_copy(x, y) x = y 68 79 #define atoll _atoi64 … … 82 93 extern LIBTYPE void msleep_approx(uint64_t ms); 83 94 extern LIBTYPE void msleep_minimum(uint64_t ms); 84 95 96 #if !defined(PTHREAD_H) 85 97 extern LIBTYPE int pthread_create(pthread_t *tid, void *attr, LPTHREAD_START_ROUTINE start, void *arg); 86 98 extern LIBTYPE int pthread_join(pthread_t tid, void **value_ptr); 87 99 extern LIBTYPE void pthread_mutex_init(pthread_mutex_t *mutex, void *attr); 88 100 extern LIBTYPE void pthread_mutex_lock(pthread_mutex_t *mutex); 89 101 extern LIBTYPE void pthread_mutex_unlock(pthread_mutex_t *mutex); 102 #endif 90 103 91 104 /* 92 105 * 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
old new 76 76 } 77 77 } 78 78 79 #if !defined(PTHREAD_H) 79 80 int pthread_create(pthread_t *tid, void *attr, LPTHREAD_START_ROUTINE start, void *arg) 80 81 { 81 82 *tid = CreateThread(NULL, 0, start, arg, 0, NULL); … … 112 113 { 113 114 ReleaseMutex(*mutex); 114 115 } 116 #endif 115 117 116 118 /* 117 119 * The console output format should be set to UTF-8, however in XP and Vista this breaks batch file processing. -
libs\libmythhdhomerun\libmythhdhomerun.pro
old new 32 32 mingw { 33 33 HEADERS += hdhomerun_os_windows.h 34 34 SOURCES += hdhomerun_os_windows.c 35 SOURCES -= hdhomerun_os_posix.c 35 36 SOURCES += hdhomerun_sock_windows.c 36 37 LIBS += -lws2_32 -liphlpapi -lpthread 37 38 }