diff options
author | Evgenii Kliuchnikov <eustas@google.com> | 2023-08-25 01:06:33 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-08-25 01:07:12 -0700 |
commit | c1bd196833e4ce05ef49b82ec5e124bb79e095ff (patch) | |
tree | e7303c45defffa30b8d531a737137de7fb10ad8f | |
parent | 2a5a088b03ba5fd3aab4f34338c84e2c61d82c49 (diff) | |
download | brotli-c1bd196833e4ce05ef49b82ec5e124bb79e095ff.zip brotli-c1bd196833e4ce05ef49b82ec5e124bb79e095ff.tar.gz brotli-c1bd196833e4ce05ef49b82ec5e124bb79e095ff.tar.bz2 |
comb HAVE_UTIMENSAT definition
PiperOrigin-RevId: 560011681
-rw-r--r-- | c/tools/brotli.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/c/tools/brotli.c b/c/tools/brotli.c index 432fa52..03f2d06 100644 --- a/c/tools/brotli.c +++ b/c/tools/brotli.c @@ -75,17 +75,23 @@ static int ms_open(const char* filename, int oflag, int pmode) { #define MAKE_BINARY(FILENO) (FILENO) #endif /* defined(_WIN32) */ -#if defined(__APPLE__) && !defined(_POSIX_C_SOURCE) +#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L) #define HAVE_UTIMENSAT 1 +#elif defined(_ATFILE_SOURCE) +#define HAVE_UTIMENSAT 1 +#else +#define HAVE_UTIMENSAT 0 +#endif + +#if HAVE_UTIMENSAT +#if defined(__APPLE__) #define ATIME_NSEC(S) ((S)->st_atimespec.tv_nsec) #define MTIME_NSEC(S) ((S)->st_mtimespec.tv_nsec) -#elif defined(_WIN32) || !defined(AT_SYMLINK_NOFOLLOW) -#define HAVE_UTIMENSAT 0 -#else -#define HAVE_UTIMENSAT 1 +#else /* defined(__APPLE__) */ #define ATIME_NSEC(S) ((S)->st_atim.tv_nsec) #define MTIME_NSEC(S) ((S)->st_mtim.tv_nsec) #endif +#endif /* HAVE_UTIMENSAT */ typedef enum { COMMAND_COMPRESS, |