You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
我使用mingw32 编译器,编译过程中遇到一点小瑕疵错误,因为mingw32仍然需要命名空间支持
[ 99%] Building CXX object CMakeFiles/TNN.dir/source/tnn/utils/split_utils.cc.obj
D:\TNN\source\tnn\utils\split_utils.cc: In static member function 'static tnn::Status tnn::SplitUtils::SplitStr(const char*, tnn::str_arr&, const char*, bool, bool, bool, bool, bool)':
D:\TNN\source\tnn\utils\split_utils.cc:163:23: error: 'min' was not declared in this scope
int len = min((i - cursor), subs_length - 1);
所以我修改为三目运算符,感觉好一点
#if defined(WIN32) && _MSC_VER < 1300 // VC++ 6.0
//int len = min((i - cursor), subs_length - 1);
int len = (i - cursor)>=(subs_length - 1)?(subs_length - 1):(i - cursor);
#else
int len = std::min(i - cursor, subs_length - 1);
#endif
仅建议
The text was updated successfully, but these errors were encountered:
我使用mingw32 编译器,编译过程中遇到一点小瑕疵错误,因为mingw32仍然需要命名空间支持
[ 99%] Building CXX object CMakeFiles/TNN.dir/source/tnn/utils/split_utils.cc.obj
D:\TNN\source\tnn\utils\split_utils.cc: In static member function 'static tnn::Status tnn::SplitUtils::SplitStr(const char*, tnn::str_arr&, const char*, bool, bool, bool, bool, bool)':
D:\TNN\source\tnn\utils\split_utils.cc:163:23: error: 'min' was not declared in this scope
int len = min((i - cursor), subs_length - 1);
所以我修改为三目运算符,感觉好一点
#if defined(WIN32) && _MSC_VER < 1300 // VC++ 6.0
//int len = min((i - cursor), subs_length - 1);
int len = (i - cursor)>=(subs_length - 1)?(subs_length - 1):(i - cursor);
#else
int len = std::min(i - cursor, subs_length - 1);
#endif
仅建议
The text was updated successfully, but these errors were encountered: