From cf41dee0f6fe130e9e3b08c45492e47df07e2d2d Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Thu, 29 Jul 2021 01:41:10 +0800 Subject: [PATCH] fs: Don't define UTIME_OMIT if __cplusplus is defined to avoid libcxx misdetect NuttX support utimensat(_LIBCPP_USE_UTIMENSAT). This patch need be reverted after utimensat is supported in NuttX. Signed-off-by: Xiang Xiao --- include/sys/stat.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/sys/stat.h b/include/sys/stat.h index 539188bb3fe..8c1496bf485 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -110,7 +110,9 @@ /* Special value for tv_nsec field of timespec */ #define UTIME_NOW ((1l << 30) - 1l) -#define UTIME_OMIT ((1l << 30) - 2l) +#ifndef __cplusplus +# define UTIME_OMIT ((1l << 30) - 2l) +#endif /* The following macros are required by POSIX to achieve backward * compatibility with earlier versions of struct stat.