Skip to content

Commit

Permalink
Do not use LFS64 on non-glibc linux (#5668)
Browse files Browse the repository at this point in the history
Signed-off-by: leso-kn <info@lesosoftware.com>
  • Loading branch information
leso-kn committed Oct 14, 2023
1 parent 34cc49d commit f44275f
Showing 1 changed file with 3 additions and 3 deletions.
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 @@ void check_tensor(const TensorProto& tensor, const CheckerContext& ctx) {
}
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

0 comments on commit f44275f

Please sign in to comment.