From 908138d81ad4fc6916a51d1da3e328ed0c3c3e82 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Sat, 19 Nov 2016 19:46:37 +0000 Subject: [PATCH] Fix build on FreeBSD (#4051) * Fix radio firmwares build under FreeBSD (#4050) * Fix companion "mountlist" build under FreeBSD (#4049) --- companion/src/storage/mountlist.cpp | 2 +- radio/src/targets/simu/simpgmspace.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/companion/src/storage/mountlist.cpp b/companion/src/storage/mountlist.cpp index 7855eab11..fbbefc973 100644 --- a/companion/src/storage/mountlist.cpp +++ b/companion/src/storage/mountlist.cpp @@ -455,7 +455,7 @@ read_file_system_list (bool need_fs_type) me = (mount_entry *) malloc (sizeof *me); me->me_devname = strdup (fsp->f_mntfromname); me->me_mountdir = strdup (fsp->f_mntonname); -#if defined(__APPLE__) || defined(__OpenBSD__) +#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) me->me_type = fsp->f_fstypename; #else me->me_type = fsp->fs_typename; diff --git a/radio/src/targets/simu/simpgmspace.cpp b/radio/src/targets/simu/simpgmspace.cpp index bcaa1a9fe..9994ae57f 100644 --- a/radio/src/targets/simu/simpgmspace.cpp +++ b/radio/src/targets/simu/simpgmspace.cpp @@ -601,7 +601,7 @@ char *findTrueFileName(const char *path) for (;;) { struct simu::dirent * res = simu::readdir(dir); if (res == 0) break; -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) if ((res->d_type == DT_REG) || (res->d_type == DT_LNK)) { #else if ((res->d_type == simu::DT_REG) || (res->d_type == simu::DT_LNK)) { @@ -771,7 +771,7 @@ FRESULT f_readdir (DIR * rep, FILINFO * fil) if (strcmp(ent->d_name, ".") && strcmp(ent->d_name, "..") ) break; } -#if defined(WIN32) || !defined(__GNUC__) || defined(__APPLE__) +#if defined(WIN32) || !defined(__GNUC__) || defined(__APPLE__) || defined(__FreeBSD__) fil->fattrib = (ent->d_type == DT_DIR ? AM_DIR : 0); #else if (ent->d_type == simu::DT_UNKNOWN) {