mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-22 03:19:25 -04:00
DATV demod: adapt to MSVC
This commit is contained in:
parent
c8480a58fe
commit
788ffa7c86
plugins/channelrx/demoddatv
@ -19,7 +19,6 @@
|
||||
#ifndef DATVCONSTELLATION_H
|
||||
#define DATVCONSTELLATION_H
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <vector>
|
||||
|
||||
#include "leansdr/framework.h"
|
||||
|
@ -49,8 +49,6 @@ void DATVideostream::cleanUp()
|
||||
m_objeventLoop.exit();
|
||||
}
|
||||
|
||||
m_objMutex.unlock();
|
||||
|
||||
m_intBytesAvailable=0;
|
||||
m_intBytesWaiting=0;
|
||||
m_intQueueWaiting=0;
|
||||
|
@ -668,16 +668,17 @@ static struct fec_spec
|
||||
int bits_in; // Entering the convolutional coder
|
||||
int bits_out; // Exiting the convolutional coder
|
||||
const uint16_t *polys; // [bits_out]
|
||||
} fec_specs[FEC_MAX] =
|
||||
{ [FEC12] =
|
||||
{ 1, 2, polys_fec12 }, [FEC23] =
|
||||
{ 2, 3, polys_fec23 }, [FEC46] =
|
||||
{ 4, 6, polys_fec46 }, [FEC34] =
|
||||
{ 3, 4, polys_fec34 }, [FEC56] =
|
||||
{ 5, 6, polys_fec56 }, [FEC78] =
|
||||
{ 7, 8, polys_fec78 }, [FEC45] =
|
||||
{ 4, 5, polys_fec45 }, // Non-standard
|
||||
};
|
||||
}
|
||||
|
||||
fec_specs[FEC_MAX] = {
|
||||
[FEC12] = { 1, 2, polys_fec12 },
|
||||
[FEC23] = { 2, 3, polys_fec23 },
|
||||
[FEC46] = { 4, 6, polys_fec46 },
|
||||
[FEC34] = { 3, 4, polys_fec34 },
|
||||
[FEC56] = { 5, 6, polys_fec56 },
|
||||
[FEC78] = { 7, 8, polys_fec78 },
|
||||
[FEC45] = { 4, 5, polys_fec45 }, // Non-standard
|
||||
};
|
||||
|
||||
struct dvb_convol: runnable
|
||||
{
|
||||
|
@ -2,7 +2,13 @@
|
||||
#define LEANSDR_GENERIC_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <stdlib.h>
|
||||
#include <io.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "leansdr/math.h"
|
||||
|
||||
@ -29,7 +35,11 @@ struct file_reader: runnable
|
||||
if (!size)
|
||||
return;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
again: ssize_t nr = _read(fdin, out.wr(), size);
|
||||
#else
|
||||
again: ssize_t nr = read(fdin, out.wr(), size);
|
||||
#endif
|
||||
if (nr < 0)
|
||||
{
|
||||
fatal("leansdr::file_reader::run: read");
|
||||
@ -41,7 +51,11 @@ struct file_reader: runnable
|
||||
return;
|
||||
if (sch->debug)
|
||||
fprintf(stderr, "leansdr::file_reader::run: %s looping\n", name);
|
||||
#ifdef _MSC_VER
|
||||
off_t res = _lseek(fdin, 0, SEEK_SET);
|
||||
#else
|
||||
off_t res = lseek(fdin, 0, SEEK_SET);
|
||||
#endif
|
||||
if (res == (off_t) -1)
|
||||
{
|
||||
fatal("leansdr::file_reader::run: lseek");
|
||||
@ -57,7 +71,11 @@ struct file_reader: runnable
|
||||
{
|
||||
if (sch->debug)
|
||||
fprintf(stderr, "+");
|
||||
#ifdef _MSC_VER
|
||||
ssize_t nr2 = _read(fdin, (char*) out.wr() + nr, remain);
|
||||
#else
|
||||
ssize_t nr2 = read(fdin, (char*) out.wr() + nr, remain);
|
||||
#endif
|
||||
if (nr2 <= 0)
|
||||
{
|
||||
fatal("leansdr::file_reader::run: partial read");
|
||||
@ -89,7 +107,11 @@ struct file_writer: runnable
|
||||
int size = in.readable() * sizeof(T);
|
||||
if (!size)
|
||||
return;
|
||||
#ifdef _MSC_VER
|
||||
int nw = _write(fdout, in.rd(), size);
|
||||
#else
|
||||
int nw = write(fdout, in.rd(), size);
|
||||
#endif
|
||||
if (!nw)
|
||||
{
|
||||
fatal("leansdr::file_writer::run: pipe");
|
||||
@ -138,7 +160,11 @@ struct file_printer: runnable
|
||||
fatal("leansdr::file_printer::run: obsolete glibc");
|
||||
return;
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
int nw = _write(fdout, buf, len);
|
||||
#else
|
||||
int nw = write(fdout, buf, len);
|
||||
#endif
|
||||
if (nw != len)
|
||||
{
|
||||
fatal("leansdr::file_printer::run: partial write");
|
||||
|
Loading…
Reference in New Issue
Block a user