From 53cabe6ad687bac70f51cb39d265116ff8c8d883 Mon Sep 17 00:00:00 2001 From: s_c_c Date: Mon, 25 Mar 2024 17:04:16 +0800 Subject: [PATCH] feat for embedded fix eventhandler compile errors --- frameworks/eventhandler/BUILD.gn | 3 ++- frameworks/eventhandler/include/event_handler_utils.h | 3 ++- frameworks/napi/BUILD.gn | 3 ++- frameworks/native/BUILD.gn | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/frameworks/eventhandler/BUILD.gn b/frameworks/eventhandler/BUILD.gn index 7342337..a4be522 100644 --- a/frameworks/eventhandler/BUILD.gn +++ b/frameworks/eventhandler/BUILD.gn @@ -14,11 +14,12 @@ import("//build/ohos.gni") import("../../eventhandler.gni") import("inner_api_sources.gni") +import("//build/config/sysroot.gni") config("libeventhandler_config") { include_dirs = [ "${inner_api_path}", - "//commonlibrary/c_utils/base/include", + "${sysroot}/usr/include/c_utils", "include", ] } diff --git a/frameworks/eventhandler/include/event_handler_utils.h b/frameworks/eventhandler/include/event_handler_utils.h index 37e862f..84be89d 100644 --- a/frameworks/eventhandler/include/event_handler_utils.h +++ b/frameworks/eventhandler/include/event_handler_utils.h @@ -94,7 +94,8 @@ static inline bool AllowHiTraceOutPut(const std::shared_ptr& traceId, static inline void GetLastErr(char *errmsg, size_t size = MAX_ERRORMSG_LEN) { size = size > MAX_ERRORMSG_LEN ? MAX_ERRORMSG_LEN : size; - strerror_r(errno, errmsg, size); + char *ret = strerror_r(errno, errmsg, size); + (void)ret; } } // namespace AppExecFwk } // namespace OHOS diff --git a/frameworks/napi/BUILD.gn b/frameworks/napi/BUILD.gn index 7b6f32f..d946e4e 100644 --- a/frameworks/napi/BUILD.gn +++ b/frameworks/napi/BUILD.gn @@ -14,6 +14,7 @@ import("//build/ohos.gni") import("//build/ohos/ace/ace.gni") import("../../eventhandler.gni") +import("//build/config/sysroot.gni") ohos_shared_library("emitter") { include_dirs = [ @@ -21,7 +22,7 @@ ohos_shared_library("emitter") { "${inner_api_path}", "//third_party/node/src", "//third_party/libuv/include", - "//commonlibrary/c_utils/base/include", + "${sysroot}/usr/include/c_utils", ] sources = [ diff --git a/frameworks/native/BUILD.gn b/frameworks/native/BUILD.gn index 55e8208..6c98a96 100644 --- a/frameworks/native/BUILD.gn +++ b/frameworks/native/BUILD.gn @@ -13,15 +13,15 @@ import("//build/ohos.gni") import("../../eventhandler.gni") +import("//build/config/sysroot.gni") ohos_shared_library("eventhandler_native") { sources = [ "src/native_interface_eventhandler.cpp" ] include_dirs = [ "${kits_path}/native", - "//commonlibrary/c_utils/base/include", - "//base/hiviewdfx/interfaces/innerkits/libhilog/include", - "//base/hiviewdfx/interfaces/innerkits/libhitrace/include", + "${sysroot}/usr/include/c_utils", + "${sysroot}/usr/include/hilog", ] cflags = [ "-Wno-error=inconsistent-missing-override" ] -- 2.20.1 (Apple Git-117)