Ticket #3062: mythtv-freebsd.diff

File mythtv-freebsd.diff, 7.2 KB (added by usleepless@…, 20 years ago)
  • libs/libmythtv/videodev_myth.h

     
    55
    66#if defined(__FreeBSD__) || defined(CONFIG_DARWIN)
    77#include <sys/types.h>
    8 typedef unsigned long __u32;
    9 typedef unsigned short __u16;
    10 typedef int  __s32;
    11 typedef unsigned char __u8;
    12 typedef unsigned long long __u64;
    13 typedef long long __s64;
     8typedef uint32_t __u32;
     9typedef uint16_t __u16;
     10typedef int32_t  __s32;
     11typedef uint8_t __u8;
     12typedef uint32_t __u64;
     13typedef int32_t __s64;
    1414#else
    1515#include <linux/types.h>
    1616#include <linux/version.h>
  • libs/libmythtv/mpegrecorder.cpp

     
    828828        FD_ZERO(&rdset);
    829829        FD_SET(readfd, &rdset);
    830830
     831#if !defined(__FreeBSD__)
    831832        switch (select(readfd + 1, &rdset, NULL, NULL, &tv))
    832833        {
    833834            case -1:
     
    851852
    852853           default: break;
    853854        }
     855#endif
    854856
    855857        ret = read(readfd, buffer, bufferSize);
    856858
  • programs/mythbackend/mainserver.cpp

     
    240240        return;
    241241    }
    242242
     243#if !defined(__FreeBSD__)
    243244    readReadyLock.lock();
    244245
    245246    sock->Lock();
     247#endif
    246248
    247249    //if (socket->IsInProcess())
    248250    //{
     
    287289        threadPoolLock.unlock();
    288290    }
    289291
     292#if defined(__FreeBSD__)
     293    sock->Lock();
    290294    prt->setup(sock);
     295    sock->Unlock();
     296#else
     297    prt->setup(sock);
    291298
    292299    readReadyLock.unlock();
     300#endif
    293301}
    294302
    295303void MainServer::ProcessRequest(MythSocket *sock)
     
    303311        ProcessRequestWork(sock);
    304312    }
    305313
     314#if !defined(__FreeBSD__)
    306315    sock->Unlock();
     316#endif
    307317    //sock->SetInProcess(false);
    308318}
    309319
  • libs/libmythtv/videoout_xv.cpp

     
    77#include <ctime>
    88#include <cerrno>
    99
     10#ifdef _linux_
    1011#include <malloc.h>
     12#endif
    1113#include <fcntl.h>
    1214#include <unistd.h>
    1315#include <sys/time.h>
  • libs/libmythupnp/httprequest.cpp

     
    1818#include <qfileinfo.h>
    1919
    2020#include "mythconfig.h"
    21 #if defined CONFIG_DARWIN || defined CONFIG_CYGWIN
     21#if defined CONFIG_DARWIN || defined CONFIG_CYGWIN || defined(__FreeBSD__)
    2222#include "darwin-sendfile.h"
    2323#else
    2424#include <sys/sendfile.h>
     
    220220    // Make it so the header is sent with the data
    221221    // ----------------------------------------------------------------------
    222222
    223 #if !defined(CONFIG_DARWIN) && !defined(CONFIG_CYGWIN)
     223#if !defined(CONFIG_DARWIN) && !defined(CONFIG_CYGWIN) && !defined(__FreeBSD__)
    224224    // Never send out partially complete segments
    225225    setsockopt( getSocketHandle(), SOL_TCP, TCP_CORK, &g_on, sizeof( g_on ));
    226226#endif
     
    248248    // Turn off the option so any small remaining packets will be sent
    249249    // ----------------------------------------------------------------------
    250250
    251 #if !defined(CONFIG_DARWIN) && !defined(CONFIG_CYGWIN)
     251#if !defined(CONFIG_DARWIN) && !defined(CONFIG_CYGWIN) && !defined(__FreeBSD__)
    252252    setsockopt( getSocketHandle(), SOL_TCP, TCP_CORK, &g_off, sizeof( g_off ));
    253253#endif
    254254
     
    284284    // Make it so the header is sent with the data
    285285    // ----------------------------------------------------------------------
    286286
    287 #if !defined(CONFIG_DARWIN) && !defined(CONFIG_CYGWIN)
     287#if !defined(CONFIG_DARWIN) && !defined(CONFIG_CYGWIN) && !defined(__FreeBSD__)
    288288    // Never send out partially complete segments
    289289    setsockopt( getSocketHandle(), SOL_TCP, TCP_CORK, &g_on, sizeof( g_on ));
    290290#endif
     
    393393    // Turn off the option so any small remaining packets will be sent
    394394    // ----------------------------------------------------------------------
    395395   
    396 #if !defined(CONFIG_DARWIN) && !defined(CONFIG_CYGWIN)
     396#if !defined(CONFIG_DARWIN) && !defined(CONFIG_CYGWIN) && !defined(__FreeBSD__)
    397397    setsockopt( getSocketHandle(), SOL_TCP, TCP_CORK, &g_off, sizeof( g_off ));
    398398#endif
    399399
  • programs/mythcommflag/FrameAnalyzer.h

     
    77#ifndef __FRAMEANALYZER_H__
    88#define __FRAMEANALYZER_H__
    99
     10/*
     11 * At least FreeBSD doesn't define LONG_LONG_MAX, but it does define
     12 * __LONG_LONG_MAX__.  Who knows what other systems do the same?
     13 */
     14#ifndef LONG_LONG_MAX
     15#define LONG_LONG_MAX  __LONG_LONG_MAX__
     16#endif
     17
    1018/* Base class for commercial flagging frame analyzers. */
    1119
    1220#include <limits.h>
  • libs/libmythupnp/upnputil.h

     
    1414#include "mythcontext.h"
    1515
    1616// __suseconds_t doesn't exist on some older Unixes. e.g. Darwin/Mac OS X
     17#if defined(__FreeBSD__)
     18#define __suseconds_t_defined
     19#endif
    1720
    1821#ifndef __suseconds_t_defined
    1922#define __suseconds_t_defined
  • programs/mythbackend/backendutil.cpp

     
    11#include <cstdlib> // for llabs
    22
    33#include "mythconfig.h"
    4 #ifdef CONFIG_DARWIN
     4#if defined(CONFIG_DARWIN) || defined(__FreeBSD__)
    55#include <sys/param.h>
    66#include <sys/mount.h>
    77static inline long long int abs(long long int v) { return llabs(v); }
  • libs/libmythupnp/libmythupnp.pro

     
    7878    LIBS += -L../libmythui -lmythui-$$LIBVERSION
    7979    #QMAKE_LFLAGS_SHLIB += -flat_namespace -undefined warning
    8080}
     81
     82freebsd {
     83    HEADERS += darwin-sendfile.h
     84    SOURCES += darwin-sendfile.c
     85}
     86
  • version.pro

     
    1010SOURCES += version.cpp
    1111
    1212version.target = version.cpp
    13 version.commands = echo 'const char *myth_source_version =' \
    14 '"'`(svnversion $${SVNTREEDIR} 2>/dev/null) || echo Unknown`'";' > .vers.new ; \
     13version.commands = sh -c "echo 'const char *myth_source_version =' \
     14'\"'`(svnversion $${SVNTREEDIR} 2>/dev/null) || echo Unknown`'\";' > .vers.new ; \
    1515diff .vers.new version.cpp > .vers.diff 2>&1 ; \
    1616if test -s .vers.diff ; then mv -f .vers.new version.cpp ; fi ; \
    17 rm -f .vers.new .vers.diff
     17rm -f .vers.new .vers.diff"
    1818version.depends = FORCE
    1919
    2020QMAKE_EXTRA_UNIX_TARGETS += version