From daf125f265724a2713445b94e7a06e973184ba12 Mon Sep 17 00:00:00 2001 From: Lautis Sun Date: Thu, 11 Nov 2021 23:34:31 +0800 Subject: [PATCH] Use lstat() for macOS and *BSD (bug fix) Refer to issue #63. Thanks to @wojdyr. --- tinydir.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tinydir.h b/tinydir.h index e08eb84..9ef0ac8 100644 --- a/tinydir.h +++ b/tinydir.h @@ -543,7 +543,9 @@ int tinydir_readfile(const tinydir_dir *dir, tinydir_file *file) if (_tstat( #elif (defined _BSD_SOURCE) || (defined _DEFAULT_SOURCE) \ || ((defined _XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)) \ - || ((defined _POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L)) + || ((defined _POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L)) \ + || ((defined __APPLE__) && (defined __MACH__)) \ + || (defined BSD) if (lstat( #else if (stat(