diff --git a/tiny_gltf.h b/tiny_gltf.h index 5ae87c0..9b318f2 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -2851,7 +2851,7 @@ bool FileExists(const std::string &abs_filename, void *) { } #else #ifdef _WIN32 -#if defined(_MSC_VER) || defined(__GLIBCXX__) || defined(_LIBCPP_VERSION) +#if defined(_MSC_VER) || defined(_LIBCPP_VERSION) // First check if a file is a directory. DWORD result = GetFileAttributesW(UTF8ToWchar(abs_filename).c_str()); @@ -2867,6 +2867,11 @@ bool FileExists(const std::string &abs_filename, void *) { if (err != 0) { return false; } +#elif defined(__GLIBCXX__) + FILE *fp = fopen(abs_filename.c_str(), "rb"); + if (!fp) { + return false; + } #else // TODO: is_directory check FILE *fp = nullptr;