Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cxong/tinydir.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLautis Sun <lautis0503@gmail.com>2019-02-10 16:03:52 +0300
committerLautis Sun <lautis0503@gmail.com>2019-02-10 16:06:26 +0300
commit4e17cff96be617855af461cb96784e096fcaf0f8 (patch)
tree67c07d28f90a296b1c94221f49636efb80a521d5
parentfab88213e7273e2ccc2068ac3bacef2409845bd5 (diff)
Use lstat() instead of stat() when available. (fixes #63)
-rw-r--r--tinydir.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tinydir.h b/tinydir.h
index 5b9dc48..b3aa898 100644
--- a/tinydir.h
+++ b/tinydir.h
@@ -551,6 +551,10 @@ int tinydir_readfile(const tinydir_dir *dir, tinydir_file *file)
#ifndef _MSC_VER
#ifdef __MINGW32__
if (_tstat(
+#elif (defined _BSD_SOURCE) || (defined _DEFAULT_SOURCE) \
+ || ((defined _XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)) \
+ || ((defined _POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L))
+ if (lstat(
#else
if (stat(
#endif