diff --git a/tiny_gltf.h b/tiny_gltf.h index 9bba9c4..49c313b 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -2618,9 +2618,11 @@ bool ReadWholeFile(std::vector *out, std::string *err, _wopen(UTF8ToWchar(filepath).c_str(), _O_RDONLY | _O_BINARY); __gnu_cxx::stdio_filebuf wfile_buf(file_descriptor, std::ios_base::in); std::istream f(&wfile_buf); -#elif defined(_MSC_VER) +#elif defined(_MSC_VER) || defined(_LIBCPP_VERSION) + // For libcxx, assume _LIBCPP_HAS_OPEN_WITH_WCHAR is defined to accept `wchar_t *` std::ifstream f(UTF8ToWchar(filepath).c_str(), std::ifstream::binary); -#else // clang? +#else + // Unknown compiler/runtime std::ifstream f(filepath.c_str(), std::ifstream::binary); #endif #else