[PATCH] D34249: [libc++] Don't use UTIME_OMIT to detect utimensat on Apple

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 15 15:42:19 PDT 2017


EricWF added inline comments.


================
Comment at: src/experimental/filesystem/operations.cpp:23-28
+// We can use the presence of UTIME_OMIT to detect platforms that do not
+// provide utimensat, with some exceptions on OS X.
+#if !defined(UTIME_OMIT) || \
+   (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1030)
+#define _LIBCPP_HAS_NO_UTIMENSAT
+#endif
----------------
dexonsmith wrote:
> Sadly this isn't quite sufficient.  As per Jack's suggested SDK patch in the PR, we need to enumerate the platforms :/.  I think this should be the right logic for the four Darwin platforms:
> 
>     (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_11_0) || \
>     (defined(__WATCH_OS_VERSION_MIN_REQUIRED) &&  __WATCH_OS_VERSION_MIN_REQUIRED < __WATCHOS_4_0)  || \
>     (defined(__TV_OS_VERSION_MIN_REQUIRED) && __TV_OS_VERSION_MIN_REQUIRED < __TVOS_11_0)           || \
>     (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_13)
> 
Do we have to do the below dance for all of those macros?

```
#if !defined(__FOO_VERSION_MIN_REQUIRED) && defined(__ENVIROMENT_FOO_VERSION_MIN_REQUIRED)
#define __FOO_VERSION_MIN_REQUIRED __ENVIROMENT_FOO_VERSION_REQUIRED
#endif
```


https://reviews.llvm.org/D34249





More information about the cfe-commits mailing list