Skip to content

Commit 6335775

Browse files
committed
Fix sys/stat.h issue for unit tests on macOS
1 parent 0e89f9d commit 6335775

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

UNITTESTS/target_h/platform/mbed_retarget.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424

2525
#include <time.h>
2626

27+
#if defined __has_include
28+
# if __has_include (<sys/stat.h>)
29+
# include <sys/stat.h>
30+
# define HAVE_SYS_STAT_H
31+
# endif
32+
#endif
33+
34+
2735
namespace mbed {
2836

2937
#define NAME_MAX 255
@@ -362,7 +370,7 @@ namespace mbed {
362370
#define STDOUT_FILENO 1
363371
#define STDERR_FILENO 2
364372

365-
#ifndef _STAT_VER
373+
#ifndef HAVE_SYS_STAT_H
366374
struct stat {
367375
dev_t st_dev; ///< Device ID containing file
368376
ino_t st_ino; ///< File serial number

0 commit comments

Comments
 (0)