From b05ed4c81a6c22b5f98a3425b6f7b4cd059f8a15 Mon Sep 17 00:00:00 2001 From: yueyan Date: Fri, 8 Sep 2023 19:41:52 +0800 Subject: [PATCH] fixed fa132e6 from https://gitee.com/yueyan233/drivers_hdf_core/pulls/1976 fix:compiler error of hdi code in small system Signed-off-by: yueyan --- adapter/uhdf/hdi_small.gni | 19 +++++++++++++------ framework/tools/hdi-gen/ast/ast_attribute.h | 5 +++++ framework/tools/hdi-gen/ast/ast_method.h | 6 +++--- framework/tools/hdi-gen/parser/parser.cpp | 2 +- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/adapter/uhdf/hdi_small.gni b/adapter/uhdf/hdi_small.gni index 9b05b447f..37640791a 100644 --- a/adapter/uhdf/hdi_small.gni +++ b/adapter/uhdf/hdi_small.gni @@ -126,15 +126,16 @@ template("hdi_small") { if (defined(invoker.sources)) { sources = hdi_build_info.proxy_sources public_configs = [ ":$idl_headers_config" ] - deps = [ - ":hdi_gen", - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//third_party/bounds_checking_function:libsec_shared", - ] + deps = [ ":hdi_gen" ] public_deps = hdi_build_info.proxy_deps - external_deps = [ "hdf_core:libhdi" ] + external_deps = [ + "bounds_checking_function:libsec_shared", + "hdf_core:libhdi", + "hilog_lite:hilog_shared", + ] + if (invoker.language == "c") { external_deps += [ "hdf_core:libhdf_utils" ] } @@ -150,6 +151,12 @@ template("hdi_small") { } } + lib_server = "lib" + target_name + "_stub" + "_" + hdi_build_info.version + group(lib_server) { + public_configs = [ ":$idl_headers_config" ] + deps = [ ":hdi_gen" ] + } + # generate code and shared library group("$target_name" + "_idl_target") { deps = [ ":$lib_client" ] diff --git a/framework/tools/hdi-gen/ast/ast_attribute.h b/framework/tools/hdi-gen/ast/ast_attribute.h index bc272ab3a..7a438580a 100644 --- a/framework/tools/hdi-gen/ast/ast_attribute.h +++ b/framework/tools/hdi-gen/ast/ast_attribute.h @@ -34,6 +34,11 @@ public: value_ |= value; } + inline Attribute GetValue() const + { + return value_; + } + bool HasValue(Attribute attr) const { return (value_ & attr) != 0; diff --git a/framework/tools/hdi-gen/ast/ast_method.h b/framework/tools/hdi-gen/ast/ast_method.h index 2eeaa5b92..89e44ce4a 100644 --- a/framework/tools/hdi-gen/ast/ast_method.h +++ b/framework/tools/hdi-gen/ast/ast_method.h @@ -29,10 +29,10 @@ public: return name_; } - inline void SetAttribute(const AutoPtr &attr) + inline void SetAttribute(AutoPtr attr) { - if (attr != nullptr) { - attr_ = attr; + if (attr_ != nullptr && attr != nullptr) { + attr_->SetValue(attr->GetValue()); } } diff --git a/framework/tools/hdi-gen/parser/parser.cpp b/framework/tools/hdi-gen/parser/parser.cpp index de44c8992..396686972 100644 --- a/framework/tools/hdi-gen/parser/parser.cpp +++ b/framework/tools/hdi-gen/parser/parser.cpp @@ -610,7 +610,7 @@ void Parser::CheckMethodAttr(const AutoPtr &interface, const A { // if the attribute of method is empty, the default value is attribute of interface if (!method->IsMini() && !method->IsLite() && !method->IsFull()) { - method->GetAttribute()->SetValue(ASTAttr::FULL | ASTAttr::LITE | ASTAttr::MINI); + method->SetAttribute(interface->GetAttribute()); } if (!interface->IsMini() && method->IsMini()) { -- Gitee