diff --git a/libraries/AP_Filesystem/AP_Filesystem_posix.cpp b/libraries/AP_Filesystem/AP_Filesystem_posix.cpp index b3dd3f7165..10e64cd232 100644 --- a/libraries/AP_Filesystem/AP_Filesystem_posix.cpp +++ b/libraries/AP_Filesystem/AP_Filesystem_posix.cpp @@ -20,7 +20,11 @@ #if CONFIG_HAL_BOARD == HAL_BOARD_SITL || CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if defined(__APPLE__) +#include +#else #include +#endif #include extern const AP_HAL::HAL& hal; diff --git a/libraries/AP_Filesystem/posix_compat.h b/libraries/AP_Filesystem/posix_compat.h index ecbe3c6a0d..28228587fc 100644 --- a/libraries/AP_Filesystem/posix_compat.h +++ b/libraries/AP_Filesystem/posix_compat.h @@ -87,7 +87,9 @@ int apfs_remove(const char *pathname); #define ftell(stream) apfs_ftell(stream) #define freopen(pathname, mode, stream) apfs_freopen(pathname, mode, stream) #define remove(pathname) apfs_remove(pathname) +#if !defined(__APPLE__) int sprintf(char *str, const char *format, ...); +#endif #ifdef __cplusplus }