diff --git a/runtime/onnxruntime/src/CMakeLists.txt b/runtime/onnxruntime/src/CMakeLists.txt index ad83fe739..40712f59f 100644 --- a/runtime/onnxruntime/src/CMakeLists.txt +++ b/runtime/onnxruntime/src/CMakeLists.txt @@ -11,7 +11,7 @@ if(GPU) set(files ${files} "${CMAKE_CURRENT_SOURCE_DIR}/paraformer-torch.cpp") endif() -message("files: "${files}) +message("files: ${files}") if(WIN32) add_compile_options("$<$:/execution-charset:utf-8>") diff --git a/runtime/onnxruntime/src/ct-transformer-online.cpp b/runtime/onnxruntime/src/ct-transformer-online.cpp index 3be99b845..d3d1612b1 100644 --- a/runtime/onnxruntime/src/ct-transformer-online.cpp +++ b/runtime/onnxruntime/src/ct-transformer-online.cpp @@ -45,7 +45,7 @@ string CTTransformerOnline::AddPunc(const char* sz_input, vector &arr_ca strText = accumulate(arr_cache.begin(), arr_cache.end(), strText); // 如果上一句的结尾是英语字母,并且这一句的开始也是英语字母,应该添加空格 - if ((strText.size() > 0 and !(strText[strText.size()-1] & 0x80)) && (strlen(sz_input) > 0 && !(sz_input[0] & 0x80))) + if ((strText.size() > 0 && !(strText[strText.size()-1] & 0x80)) && (strlen(sz_input) > 0 && !(sz_input[0] & 0x80))) strText += " "; strText += sz_input; // full_text = precache + text diff --git a/runtime/onnxruntime/third_party/kaldi/base/kaldi-types.h b/runtime/onnxruntime/third_party/kaldi/base/kaldi-types.h index 7ebf4f853..fd25765cf 100644 --- a/runtime/onnxruntime/third_party/kaldi/base/kaldi-types.h +++ b/runtime/onnxruntime/third_party/kaldi/base/kaldi-types.h @@ -32,7 +32,8 @@ typedef float BaseFloat; #ifdef _MSC_VER #include -#define ssize_t SSIZE_T +// Don't define ssize_t as macro - let fst/types.h handle it +// #define ssize_t SSIZE_T // This causes conflicts with fst/types.h #endif // we can do this a different way if some platform diff --git a/runtime/onnxruntime/third_party/openfst/src/include/fst/types.h b/runtime/onnxruntime/third_party/openfst/src/include/fst/types.h index 9c0b79988..48dc20893 100644 --- a/runtime/onnxruntime/third_party/openfst/src/include/fst/types.h +++ b/runtime/onnxruntime/third_party/openfst/src/include/fst/types.h @@ -35,7 +35,11 @@ using uint64 = uint64_t; #ifdef _MSC_VER // Not really Windows-specific: they should have used ptrdiff_t in the first // place. But on Windows there has never been ssize_t. +// Check if ssize_t/SSIZE_T is already defined by the SDK +#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) +// Use ptrdiff_t as ssize_t (same size as pointer) using ssize_t = std::ptrdiff_t; +#endif // !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) #endif // _MSC_VER #endif // FST_LIB_TYPES_H_ diff --git a/runtime/onnxruntime/third_party/yaml-cpp/CMakeLists.txt b/runtime/onnxruntime/third_party/yaml-cpp/CMakeLists.txt index 491f41a27..87d5c8a54 100644 --- a/runtime/onnxruntime/third_party/yaml-cpp/CMakeLists.txt +++ b/runtime/onnxruntime/third_party/yaml-cpp/CMakeLists.txt @@ -3,14 +3,14 @@ ### ## Due to Mac OSX we need to keep compatibility with CMake 2.6 # see http://www.cmake.org/Wiki/CMake_Policies -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8.12) # see http://www.cmake.org/cmake/help/cmake-2-8-docs.html#policy:CMP0012 if(POLICY CMP0012) - cmake_policy(SET CMP0012 OLD) + cmake_policy(SET CMP0012 NEW) endif() # see http://www.cmake.org/cmake/help/cmake-2-8-docs.html#policy:CMP0015 if(POLICY CMP0015) - cmake_policy(SET CMP0015 OLD) + cmake_policy(SET CMP0015 NEW) endif() # see https://cmake.org/cmake/help/latest/policy/CMP0042.html if(POLICY CMP0042)