1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-22 09:31:10 -05:00

MacOS build fixes

This commit is contained in:
Jon Beniston 2022-08-04 15:13:25 +01:00
parent 84daf16a4b
commit 23c65fc8f3
4 changed files with 25 additions and 3 deletions

View File

@ -8,6 +8,7 @@
#include <algorithm>
#include <array>
#include <cstdint>
#include <cmath>
#include <cstddef>
#include <type_traits>
#include <tuple>

View File

@ -397,9 +397,11 @@ void DATVDemodSink::CleanUpDATVFramework()
delete (leansdr::s2_fecdec<bool, leansdr::hard_sb>*) r_fecdec;
}
#if 0
if (r_fecdecsoft != nullptr) {
delete (leansdr::s2_fecdec_soft<leansdr::llr_t,leansdr::llr_sb>*) r_fecdecsoft;
}
#endif
if (r_fecdechelper != nullptr) {
delete (leansdr::s2_fecdec_helper<leansdr::llr_t,leansdr::llr_sb>*) r_fecdechelper;

View File

@ -18,17 +18,22 @@ namespace ldpctool {
class LDPCUtil
{
public:
#ifndef _MSC_VER
#if defined(__APPLE__)
// Recent versions of MacOS support aligned_alloc, but Mojave doesn't
static void *aligned_malloc(size_t alignment, size_t size)
{
return aligned_alloc(alignment, size);
void *p = nullptr;
posix_memalign(&p, alignment, size);
return p;
}
static void aligned_free(void *mem)
{
free(mem);
}
#else
#elif defined(_MSC_VER)
static void *aligned_malloc(size_t alignment, size_t size)
{
return _aligned_malloc(size, alignment);
@ -38,6 +43,16 @@ public:
{
_aligned_free(mem);
}
#else
static void *aligned_malloc(size_t alignment, size_t size)
{
return aligned_alloc(alignment, size);
}
static void aligned_free(void *mem)
{
free(mem);
}
#endif
};

View File

@ -3046,6 +3046,8 @@ struct s2_fecdec : runnable
pipewriter<int> *bitcount, *errcount;
}; // s2_fecdec
#ifdef LINUX
// Soft LDPC decoder
// Internally implemented LDPC tool. Replaces external LDPC decoder
@ -3195,6 +3197,8 @@ private:
s2_bbscrambling bbscrambling;
}; // s2_fecdec_soft
#endif
// External LDPC decoder
// Spawns a user-specified command, FEC frames on stdin/stdout.
template <typename T, int _SIZE>