diff --git a/UNITTESTS/target_h/platform/mbed_retarget.h b/UNITTESTS/target_h/platform/mbed_retarget.h index aea425ed7f..e99d42150a 100644 --- a/UNITTESTS/target_h/platform/mbed_retarget.h +++ b/UNITTESTS/target_h/platform/mbed_retarget.h @@ -24,6 +24,14 @@ #include +#if defined __has_include +# if __has_include () +# include +# define HAVE_SYS_STAT_H +# endif +#endif + + namespace mbed { #define NAME_MAX 255 @@ -362,7 +370,7 @@ namespace mbed { #define STDOUT_FILENO 1 #define STDERR_FILENO 2 -#ifndef _STAT_VER +#ifndef HAVE_SYS_STAT_H struct stat { dev_t st_dev; ///< Device ID containing file ino_t st_ino; ///< File serial number