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

File 6597-hdhr-win32.3.patch, 4.5 KB (added by Jeff Lu <jll544@…>, 16 years ago)

Updated to r21056

  • libs/libmythhdhomerun/libmythhdhomerun.pro

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

     
    3131 */
    3232
    3333#define _WINSOCKAPI_
     34// MinGW lacks wspiapi, so remove dependency by setting minimum WINVER to WinXP
     35#define WINVER 0x0501
    3436#include <windows.h>
    3537#include <winsock2.h>
    3638#include <ws2tcpip.h>
    37 #include <wspiapi.h>
     39//#include <wspiapi.h>
    3840#include <stdlib.h>
    3941#include <stdio.h>
    4042#include <stdarg.h>
     
    5355#endif
    5456
    5557typedef int bool_t;
     58/* Use MinGW includes instead of these...
    5659typedef signed __int8 int8_t;
    5760typedef signed __int16 int16_t;
    5861typedef signed __int32 int32_t;
     
    6366typedef unsigned __int64 uint64_t;
    6467typedef HANDLE pthread_t;
    6568typedef HANDLE pthread_mutex_t;
     69*/
     70#include <stdint.h>
     71#include <pthread.h>
    6672
     73// Avoid #define conflicts by limiting scope to non-c++
     74#ifndef __cplusplus
    6775#define socklen_t int
    6876#define close closesocket
    6977#define sock_getlasterror WSAGetLastError()
    7078#define sock_getlasterror_socktimeout (WSAGetLastError() == WSAETIMEDOUT)
    71 #define va_copy(x, y) x = y
     79//#define va_copy(x, y) x = y
    7280#define atoll _atoi64
    7381#define strdup _strdup
    7482#define strcasecmp _stricmp
     
    8997        Sleep(sec * 1000);
    9098        return 0;
    9199}
     100#endif
    92101
    93102static inline uint64_t getcurrenttime(void)
    94103{
     
    103112        return setsockopt(s, level, optname, (char *)&t, sizeof(t));
    104113}
    105114
     115/* MythTV uses pthreads lib instead of these...
    106116static inline int pthread_create(pthread_t *tid, void *attr, LPTHREAD_START_ROUTINE start, void *arg)
    107117{
    108118        *tid = CreateThread(NULL, 0, start, arg, 0, NULL);
     
    139149{
    140150        ReleaseMutex(*mutex);
    141151}
     152*/
    142153
    143154/*
    144155 * The console output format should be set to UTF-8, however in XP and Vista this breaks batch file processing.
     
    153164        SetConsoleOutputCP(cp);
    154165}
    155166
     167
    156168static inline void console_printf(const char *fmt, ...)
    157169{
    158170        va_list ap;
  • 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/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>
  • libs/libmythtv/libmythtv.pro

     
    571571    SOURCES += videoout_d3d.cpp
    572572
    573573    LIBS += -lpthread
     574    LIBS += -lws2_32
    574575}
    575576
    576577# install headers required by mytharchive