Skip to content

Commit

Permalink
MSVC compatibility (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
f4exb committed Nov 28, 2018
1 parent 299ebce commit 03639a4
Show file tree
Hide file tree
Showing 30 changed files with 134 additions and 43 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Expand Up @@ -70,6 +70,7 @@ set(dsdcc_SOURCES
mbefec.cpp
locator.cpp
phaselock.cpp
timeutil.cpp
)

set(dsdcc_HEADERS
Expand Down Expand Up @@ -103,6 +104,8 @@ set(dsdcc_HEADERS
locator.h
phaselock.h
iirfilter.h
timeutil.h
export.h
)

if (USE_MBELIB AND LIBMBE_FOUND)
Expand Down
6 changes: 4 additions & 2 deletions crc.h
Expand Up @@ -19,10 +19,12 @@
#ifndef CRC_H_
#define CRC_H_

#include "export.h"

namespace DSDcc
{

class CRC
class DSDCC_API CRC
{
public:
CRC(unsigned long polynomial,
Expand Down Expand Up @@ -115,7 +117,7 @@ class CRC
* https://github.com/f4goh/DSTAR
* Many thanks to Anthony, F4GOH!
*/
class DStarCRC
class DSDCC_API DStarCRC
{
public:
DStarCRC();
Expand Down
4 changes: 3 additions & 1 deletion descramble.h
Expand Up @@ -17,10 +17,12 @@
#ifndef DSDCC_DESCRAMBLE_H_
#define DSDCC_DESCRAMBLE_H_

#include "export.h"

namespace DSDcc
{

class Descramble
class DSDCC_API Descramble
{
public:
static void scramble (unsigned char *in, unsigned char *out);
Expand Down
3 changes: 2 additions & 1 deletion dmr.h
Expand Up @@ -18,13 +18,14 @@
#define DMR_H_

#include "fec.h"
#include "export.h"

namespace DSDcc
{

class DSDDecoder;

class DSDDMR
class DSDCC_API DSDDMR
{
public:
typedef enum
Expand Down
3 changes: 2 additions & 1 deletion dpmr.h
Expand Up @@ -18,13 +18,14 @@
#define DPMR_H_

#include "fec.h"
#include "export.h"

namespace DSDcc
{

class DSDDecoder;

class DSDdPMR
class DSDCC_API DSDdPMR
{
public:
typedef enum
Expand Down
3 changes: 2 additions & 1 deletion dsd_decoder.h
Expand Up @@ -28,13 +28,14 @@
#include "dstar.h"
#include "nxdn.h"
#include "locator.h"
#include "export.h"

#define DSD_SQUELCH_TIMEOUT_SAMPLES 960 // 200ms timeout after return to sync search

namespace DSDcc
{

class DSDDecoder
class DSDCC_API DSDDecoder
{
friend class DSDSymbol;
friend class DSDMBEDecoder;
Expand Down
7 changes: 4 additions & 3 deletions dsd_filters.h
Expand Up @@ -21,11 +21,12 @@
#define NXZEROS 134

#include "iirfilter.h"
#include "export.h"

namespace DSDcc
{

class DSDFilters
class DSDCC_API DSDFilters
{
public:
DSDFilters();
Expand Down Expand Up @@ -53,7 +54,7 @@ class DSDFilters
* \Brief: This is a second order bandpass filter using recursive method. r is in range ]0..1[ the higher the steeper the filter.
* inspired by:http://www.ece.umd.edu/~tretter/commlab/c6713slides/FSKSlides.pdf
*/
class DSDSecondOrderRecursiveFilter
class DSDCC_API DSDSecondOrderRecursiveFilter
{
public:
DSDSecondOrderRecursiveFilter(float samplingFrequency, float centerFrequency, float r);
Expand Down Expand Up @@ -89,7 +90,7 @@ class DSDSecondOrderRecursiveFilter
*
*/

class DSDMBEAudioInterpolatorFilter
class DSDCC_API DSDMBEAudioInterpolatorFilter
{
public:
DSDMBEAudioInterpolatorFilter();
Expand Down
4 changes: 3 additions & 1 deletion dsd_logger.h
Expand Up @@ -20,10 +20,12 @@
#include <stdio.h>
#include <cstdarg>

#include "export.h"

namespace DSDcc
{

class DSDLogger
class DSDCC_API DSDLogger
{
public:
DSDLogger();
Expand Down
3 changes: 2 additions & 1 deletion dsd_mbe.h
Expand Up @@ -18,14 +18,15 @@
#define DSDCC_DSD_MBE_H_

#include "dsd_filters.h"
#include "export.h"

namespace DSDcc
{

class DSDDecoder;
struct DSDmbelibParms;

class DSDMBEDecoder
class DSDCC_API DSDMBEDecoder
{
public:
explicit DSDMBEDecoder(DSDDecoder *dsdDecoder);
Expand Down
3 changes: 2 additions & 1 deletion dsd_mbelib.h
Expand Up @@ -18,6 +18,7 @@
#define DSD_MBELIB_H_

#include <stdlib.h>
#include "export.h"

extern "C" {
#include <mbelib.h>
Expand All @@ -26,7 +27,7 @@ extern "C" {
namespace DSDcc
{

struct DSDmbelibParms
struct DSDCC_API DSDmbelibParms
{
mbe_parms *m_cur_mp;
mbe_parms *m_prev_mp;
Expand Down
4 changes: 3 additions & 1 deletion dsd_opts.h
Expand Up @@ -17,10 +17,12 @@
#ifndef DSDCC_DSD_OPTS_H_
#define DSDCC_DSD_OPTS_H_

#include "export.h"

namespace DSDcc
{

class DSDOpts
class DSDCC_API DSDOpts
{
public:
DSDOpts();
Expand Down
3 changes: 2 additions & 1 deletion dsd_state.h
Expand Up @@ -22,11 +22,12 @@
#include <string.h>

#include "p25p1_heuristics.h"
#include "export.h"

namespace DSDcc
{

class DSDState
class DSDCC_API DSDState
{
public:
DSDState();
Expand Down
3 changes: 2 additions & 1 deletion dsd_symbol.h
Expand Up @@ -21,13 +21,14 @@
#include "doublebuffer.h"
#include "runningmaxmin.h"
#include "phaselock.h"
#include "export.h"

namespace DSDcc
{

class DSDDecoder;

class DSDSymbol
class DSDCC_API DSDSymbol
{
public:
explicit DSDSymbol(DSDDecoder *dsdDecoder);
Expand Down
3 changes: 2 additions & 1 deletion dstar.h
Expand Up @@ -21,13 +21,14 @@
#include "viterbi3.h"
#include "crc.h"
#include "locator.h"
#include "export.h"

namespace DSDcc
{

class DSDDecoder;

class DSDDstar
class DSDCC_API DSDDstar
{
public:
explicit DSDDstar(DSDDecoder *dsdDecoder);
Expand Down
45 changes: 45 additions & 0 deletions export.h
@@ -0,0 +1,45 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2018 Edouard Griffiths, F4EXB. //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////

#ifndef __DSDCC_EXPORT_H
#define __DSDCC_EXPORT_H

#if defined (__GNUC__) && (__GNUC__ >= 4)
# define __DSDCC_EXPORT __attribute__((visibility("default")))
# define __DSDCC_IMPORT __attribute__((visibility("default")))

#elif defined (_MSC_VER)
# define __DSDCC_EXPORT __declspec(dllexport)
# define __DSDCC_IMPORT __declspec(dllimport)

#else
# define __DSDCC_EXPORT
# define __DSDCC_IMPORT
#endif

/* The 'DSDCC_API' controls the import/export of 'sdrbase' symbols and classes.
*/
#if !defined(dsdcc_STATIC)
# if defined dsdcc_EXPORTS
# define DSDCC_API __DSDCC_EXPORT
# else
# define DSDCC_API __DSDCC_IMPORT
# endif
#else
# define DSDCC_API
#endif

#endif // __DSDCC_EXPORT_H
18 changes: 10 additions & 8 deletions fec.h
Expand Up @@ -17,10 +17,12 @@
#ifndef FEC_H_
#define FEC_H_

#include "export.h"

namespace DSDcc
{

class Hamming_7_4
class DSDCC_API Hamming_7_4
{
public:
Hamming_7_4();
Expand All @@ -36,7 +38,7 @@ class Hamming_7_4
static const unsigned char m_H[7*3]; //!< Parity check matrix of bits
};

class Hamming_12_8
class DSDCC_API Hamming_12_8
{
public:
Hamming_12_8();
Expand All @@ -52,7 +54,7 @@ class Hamming_12_8
static const unsigned char m_H[12*4]; //!< Parity check matrix of bits
};

class Hamming_15_11
class DSDCC_API Hamming_15_11
{
public:
Hamming_15_11();
Expand All @@ -68,7 +70,7 @@ class Hamming_15_11
static const unsigned char m_H[15*4]; //!< Parity check matrix of bits
};

class Hamming_16_11_4
class DSDCC_API Hamming_16_11_4
{
public:
Hamming_16_11_4();
Expand All @@ -84,7 +86,7 @@ class Hamming_16_11_4
static const unsigned char m_H[16*5]; //!< Parity check matrix of bits
};

class Golay_20_8
class DSDCC_API Golay_20_8
{
public:
Golay_20_8();
Expand All @@ -100,7 +102,7 @@ class Golay_20_8
static const unsigned char m_H[20*12]; //!< Parity check matrix of bits
};

class Golay_23_12
class DSDCC_API Golay_23_12
{
public:
Golay_23_12();
Expand All @@ -116,7 +118,7 @@ class Golay_23_12
static const unsigned char m_H[23*11]; //!< Parity check matrix of bits
};

class Golay_24_12
class DSDCC_API Golay_24_12
{
public:
Golay_24_12();
Expand All @@ -132,7 +134,7 @@ class Golay_24_12
static const unsigned char m_H[24*12]; //!< Parity check matrix of bits
};

class QR_16_7_6
class DSDCC_API QR_16_7_6
{
public:
QR_16_7_6();
Expand Down
8 changes: 5 additions & 3 deletions locator.h
Expand Up @@ -24,10 +24,12 @@

#include <string>

#include "export.h"

namespace DSDcc
{

class LocatorInvalidException
class DSDCC_API LocatorInvalidException
{
public:
explicit LocatorInvalidException(std::string locator_str) : _locator_str(locator_str) {};
Expand All @@ -36,7 +38,7 @@ class LocatorInvalidException
std::string _locator_str;
};

class Locator
class DSDCC_API Locator
{
public:
Locator();
Expand Down Expand Up @@ -67,7 +69,7 @@ class Locator
float m_lon;
};

class LocPoint
class DSDCC_API LocPoint
{
public:
LocPoint() {};
Expand Down

0 comments on commit 03639a4

Please sign in to comment.