From: Brad King Date: Wed, 20 Sep 2017 14:19:38 +0000 (-0400) Subject: Do not use nanosecond file time APIs on macOS < 10.13 X-Git-Tag: v3.3.3~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47bec12b98b173d631f4279b2a9dd01bb7d2183c;p=thirdparty%2Flibarchive.git Do not use nanosecond file time APIs on macOS < 10.13 The SDK for macOS 10.13 adds `futimens` and `utimensat` so our checks for these symbols may pass. However, the symbols are not available at runtime on older macOS versions. Instead on macOS we can check for availability based on the deployment target version. --- diff --git a/libarchive/archive_platform.h b/libarchive/archive_platform.h index 34be8edaa..8bd54a696 100644 --- a/libarchive/archive_platform.h +++ b/libarchive/archive_platform.h @@ -52,6 +52,17 @@ #error Oops: No config.h and no pre-built configuration in archive_platform.h. #endif +/* On macOS check for some symbols based on the deployment target version. */ +#if defined(__APPLE__) +# undef HAVE_FUTIMENS +# undef HAVE_UTIMENSAT +# include +# if MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 +# define HAVE_FUTIMENS 1 +# define HAVE_UTIMENSAT 1 +# endif +#endif + /* It should be possible to get rid of this by extending the feature-test * macros to cover Windows API functions, probably along with non-trivial * refactoring of code to find structures that sit more cleanly on top of