Skip to content

Commit

Permalink
iOS without wstring
Browse files Browse the repository at this point in the history
Signed-off-by: liqunfu <[email protected]>
  • Loading branch information
liqunfu committed Mar 22, 2024
1 parent be9b1a4 commit dbfabdb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions onnxruntime/core/framework/tensorprotoutils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,12 @@ T resolve_external_data_location(
") should be a relative path, but it is an absolute path: ",
ToUTF8String(location));
}
#if defined(__APPLE__) && TARGET_OS_IPHONE
// workaround 'wstring' is unavailable: introduced in iOS 13.0
auto relative_path = ToWideString(file_path.lexically_normal().make_preferred().u8string());
#else
auto relative_path = file_path.lexically_normal().make_preferred().wstring();
#endif
// Check that normalized relative path contains ".." on Windows.
if (relative_path.find(L"..", 0) != std::string::npos) {
ORT_THROW(
Expand Down

0 comments on commit dbfabdb

Please sign in to comment.