Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use LFS64 on non-glibc linux (#5668) #5669

Merged
merged 1 commit into from
Oct 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions onnx/checker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,11 @@
}
std::string data_path = path_join(ctx.get_model_dir(), relative_path);
// use stat64 to check whether the file exists
#if defined(__APPLE__) || defined(__wasm__)
struct stat buffer; // APPLE does not have stat64
#if defined(__APPLE__) || defined(__wasm__) || !defined(__GLIBC__)
struct stat buffer; // APPLE, wasm and non-glic stdlibs do not have stat64

Check warning on line 194 in onnx/checker.cc

View workflow job for this annotation

GitHub Actions / Optional Lint

[cpplint] reported by reviewdog 🐶 At least two spaces is best between code and comments [whitespace/comments] [2] Raw Output: onnx/checker.cc:194: At least two spaces is best between code and comments [whitespace/comments] [2]
if (stat((data_path).c_str(), &buffer) != 0) {
#else
struct stat64 buffer; // All POSIX except APPLE have stat64
struct stat64 buffer; // All POSIX under glibc except APPLE and wasm have stat64

Check warning on line 197 in onnx/checker.cc

View workflow job for this annotation

GitHub Actions / Optional Lint

[cpplint] reported by reviewdog 🐶 At least two spaces is best between code and comments [whitespace/comments] [2] Raw Output: onnx/checker.cc:197: At least two spaces is best between code and comments [whitespace/comments] [2]
if (stat64((data_path).c_str(), &buffer) != 0) {
#endif
fail_check(
Expand Down