diff --git a/src/CBasic/CDescInfo.h b/src/CBasic/CDescInfo.h index 89deca41..65630c88 100644 --- a/src/CBasic/CDescInfo.h +++ b/src/CBasic/CDescInfo.h @@ -45,9 +45,13 @@ class CDescInfo { * 设置名称信息 * @param name * @return + * @notice 部分windows编译器不支持函数继承改变返回值类型,故做此区分 */ - virtual auto setName(const std::string& name) - -> decltype(this) { +#ifdef _WIN32 + virtual CVoidPtr setName(const std::string& name) { +#else + virtual auto setName(const std::string& name) -> decltype(this) { +#endif name_ = name; return this; } diff --git a/src/GraphCtrl/GraphElement/GElement.cpp b/src/GraphCtrl/GraphElement/GElement.cpp index 4138261d..2ddfca89 100644 --- a/src/GraphCtrl/GraphElement/GElement.cpp +++ b/src/GraphCtrl/GraphElement/GElement.cpp @@ -28,7 +28,11 @@ CVoid GElement::beforeRun() { } + #ifdef _WIN32 +CVoidPtr GElement::setName(const std::string& name) { + #else GElementPtr GElement::setName(const std::string& name) { + #endif CGRAPH_ASSERT_INIT_THROW_ERROR(false) this->name_ = name.empty() ? this->session_ : name; return this; diff --git a/src/GraphCtrl/GraphElement/GElement.h b/src/GraphCtrl/GraphElement/GElement.h index 684031a8..ae2e56cb 100644 --- a/src/GraphCtrl/GraphElement/GElement.h +++ b/src/GraphCtrl/GraphElement/GElement.h @@ -72,7 +72,11 @@ class GElement : public GElementObject, * @param name * @return */ +#ifdef _WIN32 + CVoidPtr setName(const std::string& name) override; +#else GElement* setName(const std::string& name) override; +#endif /** * 设置循环次数