Ticket #6597: 6597-hdhr-win32.2.patch

File 6597-hdhr-win32.2.patch, 4.4 KB (added by Jeff Lu <jll544@…>, 15 years ago)

Updated to r20837

  • libs/libmythhdhomerun/libmythhdhomerun.pro

     
    99target.path = $${LIBDIR}
    1010INSTALLS = target
    1111
     12mingw:LIBS += -lws2_32 -liphlpapi -lpthread
     13
    1214QMAKE_CLEAN += $(TARGET) $(TARGETA) $(TARGETD) $(TARGET0) $(TARGET1) $(TARGET2)
    1315
    1416HEADERS += hdhomerun.h  hdhomerun_os.h  hdhomerun_types.h
  • libs/libmythhdhomerun/hdhomerun_os.h

     
    2323
    2424#if defined(__WINDOWS__)
    2525#define _WINSOCKAPI_
     26// MinGW lacks wspiapi, so remove dependency by setting minimum WINVER to WinXP
     27#define WINVER 0x0501
    2628#include <windows.h>
    2729#include <winsock2.h>
    2830#include <ws2tcpip.h>
    29 #include <wspiapi.h>
     31//#include <wspiapi.h>
    3032#include <stdlib.h>
    3133#include <stdio.h>
    3234#include <stdarg.h>
     
    7880#endif
    7981
    8082typedef int bool_t;
     83/* Use MinGW includes instead of these...
    8184typedef signed __int8 int8_t;
    8285typedef signed __int16 int16_t;
    8386typedef signed __int32 int32_t;
     
    8891typedef unsigned __int64 uint64_t;
    8992typedef HANDLE pthread_t;
    9093typedef HANDLE pthread_mutex_t;
     94*/
     95#include <stdint.h>
     96#include <pthread.h>
    9197
     98// Avoid #define conflicts by limiting scope to non-c++
     99#ifndef __cplusplus
    92100#define socklen_t int
    93101#define close closesocket
    94102#define sock_getlasterror WSAGetLastError()
    95103#define sock_getlasterror_socktimeout (WSAGetLastError() == WSAETIMEDOUT)
    96 #define va_copy(x, y) x = y
     104//#define va_copy(x, y) x = y
    97105#define atoll _atoi64
    98106#define strdup _strdup
    99107#define strcasecmp _stricmp
     
    104112#define sleep(sec) Sleep((sec)*1000)
    105113#define THREAD_FUNC_PREFIX DWORD WINAPI
    106114#define SIGPIPE SIGABRT
     115#endif
    107116
    108117static inline uint64_t getcurrenttime(void)
    109118{
     
    118127        return setsockopt(s, level, optname, (char *)&t, sizeof(t));
    119128}
    120129
     130/* MythTV uses pthreads lib instead of these...
    121131static inline int pthread_create(pthread_t *tid, void *attr, LPTHREAD_START_ROUTINE start, void *arg)
    122132{
    123133        *tid = CreateThread(NULL, 0, start, arg, 0, NULL);
     
    154164{
    155165        ReleaseMutex(*mutex);
    156166}
     167*/
    157168
    158169#else /* !defined(__WINDOWS__) */
    159170
  • libs/libmythtv/hdhrchannel.cpp

     
    77// C includes
    88#include <unistd.h>
    99#include <sys/types.h>
     10#ifndef USING_MINGW
    1011#include <sys/socket.h>
    1112#include <netinet/in.h>
    1213#include <arpa/inet.h>
    1314#include <netdb.h>
     15#endif
    1416#include <sys/time.h>
    1517#include <fcntl.h>
    1618
  • libs/libmythtv/hdhrrecorder.cpp

     
    1010#include <fcntl.h>
    1111#include <unistd.h>
    1212#include <sys/types.h>
     13#ifndef USING_MINGW
    1314#include <sys/socket.h>
    1415#include <netinet/in.h>
    1516#include <arpa/inet.h>
    1617#include <netdb.h>
     18#endif
    1719#include <sys/time.h>
    1820
    1921// C++ includes
  • libs/libmythtv/hdhrsignalmonitor.cpp

     
    77#include <pthread.h>
    88#include <fcntl.h>
    99#include <unistd.h>
     10#ifndef USING_MINGW
    1011#include <sys/select.h>
     12#endif
    1113
    1214#include "mythcontext.h"
    1315#include "mythdbcon.h"
  • libs/libmythtv/libmythtv.pro

     
    581581    SOURCES += videoout_d3d.cpp
    582582
    583583    LIBS += -lpthread
     584    LIBS += -lws2_32
    584585}
    585586
    586587# install headers required by mytharchive
  • libs/libmythtv/hdhrstreamhandler.cpp

     
    44#include <pthread.h>
    55#include <fcntl.h>
    66#include <unistd.h>
     7#ifndef USING_MINGW
    78#include <sys/select.h>
    89#include <sys/ioctl.h>
     10#endif
    911
    1012// Qt headers
    1113#include <QString>