1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-27 07:16:48 -04:00

DATV demod: adapt to MSVC

This commit is contained in:
f4exb 2018-11-28 08:51:55 +01:00
parent c8480a58fe
commit 788ffa7c86
4 changed files with 37 additions and 13 deletions

View File

@ -19,7 +19,6 @@
#ifndef DATVCONSTELLATION_H #ifndef DATVCONSTELLATION_H
#define DATVCONSTELLATION_H #define DATVCONSTELLATION_H
#include <sys/time.h>
#include <vector> #include <vector>
#include "leansdr/framework.h" #include "leansdr/framework.h"

View File

@ -49,8 +49,6 @@ void DATVideostream::cleanUp()
m_objeventLoop.exit(); m_objeventLoop.exit();
} }
m_objMutex.unlock();
m_intBytesAvailable=0; m_intBytesAvailable=0;
m_intBytesWaiting=0; m_intBytesWaiting=0;
m_intQueueWaiting=0; m_intQueueWaiting=0;

View File

@ -668,15 +668,16 @@ static struct fec_spec
int bits_in; // Entering the convolutional coder int bits_in; // Entering the convolutional coder
int bits_out; // Exiting the convolutional coder int bits_out; // Exiting the convolutional coder
const uint16_t *polys; // [bits_out] const uint16_t *polys; // [bits_out]
} fec_specs[FEC_MAX] = }
{ [FEC12] =
{ 1, 2, polys_fec12 }, [FEC23] = fec_specs[FEC_MAX] = {
{ 2, 3, polys_fec23 }, [FEC46] = [FEC12] = { 1, 2, polys_fec12 },
{ 4, 6, polys_fec46 }, [FEC34] = [FEC23] = { 2, 3, polys_fec23 },
{ 3, 4, polys_fec34 }, [FEC56] = [FEC46] = { 4, 6, polys_fec46 },
{ 5, 6, polys_fec56 }, [FEC78] = [FEC34] = { 3, 4, polys_fec34 },
{ 7, 8, polys_fec78 }, [FEC45] = [FEC56] = { 5, 6, polys_fec56 },
{ 4, 5, polys_fec45 }, // Non-standard [FEC78] = { 7, 8, polys_fec78 },
[FEC45] = { 4, 5, polys_fec45 }, // Non-standard
}; };
struct dvb_convol: runnable struct dvb_convol: runnable

View File

@ -2,7 +2,13 @@
#define LEANSDR_GENERIC_H #define LEANSDR_GENERIC_H
#include <sys/types.h> #include <sys/types.h>
#ifdef _MSC_VER
#include <stdlib.h>
#include <io.h>
#else
#include <unistd.h> #include <unistd.h>
#endif
#include "leansdr/math.h" #include "leansdr/math.h"
@ -29,7 +35,11 @@ struct file_reader: runnable
if (!size) if (!size)
return; return;
#ifdef _MSC_VER
again: ssize_t nr = _read(fdin, out.wr(), size);
#else
again: ssize_t nr = read(fdin, out.wr(), size); again: ssize_t nr = read(fdin, out.wr(), size);
#endif
if (nr < 0) if (nr < 0)
{ {
fatal("leansdr::file_reader::run: read"); fatal("leansdr::file_reader::run: read");
@ -41,7 +51,11 @@ struct file_reader: runnable
return; return;
if (sch->debug) if (sch->debug)
fprintf(stderr, "leansdr::file_reader::run: %s looping\n", name); 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); off_t res = lseek(fdin, 0, SEEK_SET);
#endif
if (res == (off_t) -1) if (res == (off_t) -1)
{ {
fatal("leansdr::file_reader::run: lseek"); fatal("leansdr::file_reader::run: lseek");
@ -57,7 +71,11 @@ struct file_reader: runnable
{ {
if (sch->debug) if (sch->debug)
fprintf(stderr, "+"); 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); ssize_t nr2 = read(fdin, (char*) out.wr() + nr, remain);
#endif
if (nr2 <= 0) if (nr2 <= 0)
{ {
fatal("leansdr::file_reader::run: partial read"); fatal("leansdr::file_reader::run: partial read");
@ -89,7 +107,11 @@ struct file_writer: runnable
int size = in.readable() * sizeof(T); int size = in.readable() * sizeof(T);
if (!size) if (!size)
return; return;
#ifdef _MSC_VER
int nw = _write(fdout, in.rd(), size);
#else
int nw = write(fdout, in.rd(), size); int nw = write(fdout, in.rd(), size);
#endif
if (!nw) if (!nw)
{ {
fatal("leansdr::file_writer::run: pipe"); fatal("leansdr::file_writer::run: pipe");
@ -138,7 +160,11 @@ struct file_printer: runnable
fatal("leansdr::file_printer::run: obsolete glibc"); fatal("leansdr::file_printer::run: obsolete glibc");
return; return;
} }
#ifdef _MSC_VER
int nw = _write(fdout, buf, len);
#else
int nw = write(fdout, buf, len); int nw = write(fdout, buf, len);
#endif
if (nw != len) if (nw != len)
{ {
fatal("leansdr::file_printer::run: partial write"); fatal("leansdr::file_printer::run: partial write");