From 917f9098fccc94a52f35bfeeb69b13dc1145d30b Mon Sep 17 00:00:00 2001 From: Michael du Breuil Date: Fri, 11 Oct 2019 21:35:57 -0700 Subject: [PATCH] AP_Filesystem: Split the available define to it's own header --- libraries/AP_Filesystem/AP_Filesystem.h | 6 +---- .../AP_Filesystem/AP_Filesystem_Available.h | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 libraries/AP_Filesystem/AP_Filesystem_Available.h diff --git a/libraries/AP_Filesystem/AP_Filesystem.h b/libraries/AP_Filesystem/AP_Filesystem.h index d980132793..fb63fed4ee 100644 --- a/libraries/AP_Filesystem/AP_Filesystem.h +++ b/libraries/AP_Filesystem/AP_Filesystem.h @@ -22,11 +22,7 @@ #include #include -#if HAL_OS_POSIX_IO || HAL_OS_FATFS_IO -#define HAVE_FILESYSTEM_SUPPORT 1 -#else -#define HAVE_FILESYSTEM_SUPPORT 0 -#endif +#include "AP_Filesystem_Available.h" #if HAVE_FILESYSTEM_SUPPORT #if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS diff --git a/libraries/AP_Filesystem/AP_Filesystem_Available.h b/libraries/AP_Filesystem/AP_Filesystem_Available.h new file mode 100644 index 0000000000..c9b8bc9e8e --- /dev/null +++ b/libraries/AP_Filesystem/AP_Filesystem_Available.h @@ -0,0 +1,26 @@ +/* + 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, either version 3 of the License, or + (at your option) any later version. + + 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 for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +// minimal header for checking if AP_FS is available + +#pragma once + +#include + +#if HAL_OS_POSIX_IO || HAL_OS_FATFS_IO +#define HAVE_FILESYSTEM_SUPPORT 1 +#else +#define HAVE_FILESYSTEM_SUPPORT 0 +#endif