]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[util] Fix lstat feature test macro
authorNick Terrell <terrelln@fb.com>
Fri, 28 Sep 2018 22:08:15 +0000 (15:08 -0700)
committerNick Terrell <terrelln@fb.com>
Fri, 28 Sep 2018 22:23:09 +0000 (15:23 -0700)
programs/util.h

index e8288b8fe35fd2c8fe1b8cff46d879081e30fc15..d6184fac8ca00df4027c74bcfae93841879b4f29 100644 (file)
@@ -324,6 +324,7 @@ UTIL_STATIC U32 UTIL_isDirectory(const char* infilename)
 UTIL_STATIC 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)) \
@@ -333,6 +334,7 @@ UTIL_STATIC U32 UTIL_isLink(const char* infilename)
     stat_t statbuf;
     r = lstat(infilename, &statbuf);
     if (!r && S_ISLNK(statbuf.st_mode)) return 1;
+#endif
 #endif
     (void)infilename;
     return 0;