]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Switch Macro Guarding lstat()
authorW. Felix Handte <w@felixhandte.com>
Fri, 7 Jun 2019 19:31:33 +0000 (15:31 -0400)
committerW. Felix Handte <w@felixhandte.com>
Fri, 7 Jun 2019 19:32:28 +0000 (15:32 -0400)
programs/util.c

index 7b827d4536adaaab9b8d0c9d7d8e1ff15be9066b..6190bca50270e50030431a03063c2c40e722ca76 100644 (file)
@@ -107,19 +107,11 @@ int UTIL_isSameFile(const char* file1, const char* file2)
 U32 UTIL_isLink(const char* infilename)
 {
 /* macro guards, as defined in : https://linux.die.net/man/2/lstat */
-#ifndef __STRICT_ANSI__
-#if defined(_BSD_SOURCE) \
-    || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)) \
-    || (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) \
-    || (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L)) \
-    || (defined(__APPLE__) && defined(__MACH__)) \
-    || defined(__OpenBSD__) \
-    || defined(__FreeBSD__)
+#if PLATFORM_POSIX_VERSION >= 200112L
     int r;
     stat_t statbuf;
     r = lstat(infilename, &statbuf);
     if (!r && S_ISLNK(statbuf.st_mode)) return 1;
-#endif
 #endif
     (void)infilename;
     return 0;