[util] Fix lstat feature test macro
parent
43146d8a16
commit
09231dad4d
|
@ -324,6 +324,7 @@ UTIL_STATIC U32 UTIL_isDirectory(const char* infilename)
|
||||||
UTIL_STATIC U32 UTIL_isLink(const char* infilename)
|
UTIL_STATIC U32 UTIL_isLink(const char* infilename)
|
||||||
{
|
{
|
||||||
/* macro guards, as defined in : https://linux.die.net/man/2/lstat */
|
/* macro guards, as defined in : https://linux.die.net/man/2/lstat */
|
||||||
|
#ifndef __STRICT_ANSI__
|
||||||
#if defined(_BSD_SOURCE) \
|
#if defined(_BSD_SOURCE) \
|
||||||
|| (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)) \
|
|| (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)) \
|
||||||
|| (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) \
|
|| (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) \
|
||||||
|
@ -333,6 +334,7 @@ UTIL_STATIC U32 UTIL_isLink(const char* infilename)
|
||||||
stat_t statbuf;
|
stat_t statbuf;
|
||||||
r = lstat(infilename, &statbuf);
|
r = lstat(infilename, &statbuf);
|
||||||
if (!r && S_ISLNK(statbuf.st_mode)) return 1;
|
if (!r && S_ISLNK(statbuf.st_mode)) return 1;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
(void)infilename;
|
(void)infilename;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue