From f3d1242f732763113b9bbf9ad661acc05beaa92c Mon Sep 17 00:00:00 2001 From: houpengtao Date: Mon, 10 Jul 2023 16:51:07 +0800 Subject: [PATCH] fix xts Signed-off-by: houpengtao --- .../js/napi/rdb/include/napi_result_set.h | 10 +--------- .../js/napi/rdb/src/napi_result_set.cpp | 20 +++++++++---------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/frameworks/js/napi/rdb/include/napi_result_set.h b/frameworks/js/napi/rdb/include/napi_result_set.h index 403844c61..26fa2475c 100644 --- a/frameworks/js/napi/rdb/include/napi_result_set.h +++ b/frameworks/js/napi/rdb/include/napi_result_set.h @@ -90,12 +90,4 @@ private: }; } // namespace RdbJsKit } // namespace OHOS -#endif // RDB_JSKIT_NAPI_RESULT_SET_H - -EXTERN_C_START -__attribute__((visibility("default"))) napi_value NAPI_OHOS_Data_RdbJsKit_ResultSetProxy_NewInstance( - napi_env env, OHOS::NativeRdb::AbsSharedResultSet *resultSet); - -__attribute__((visibility("default"))) OHOS::NativeRdb::AbsSharedResultSet * -NAPI_OHOS_Data_RdbJsKit_ResultSetProxy_GetNativeObject(const napi_env &env, const napi_value &arg); -EXTERN_C_END \ No newline at end of file +#endif // RDB_JSKIT_NAPI_RESULT_SET_H \ No newline at end of file diff --git a/frameworks/js/napi/rdb/src/napi_result_set.cpp b/frameworks/js/napi/rdb/src/napi_result_set.cpp index 758f70a3e..670ab6415 100644 --- a/frameworks/js/napi/rdb/src/napi_result_set.cpp +++ b/frameworks/js/napi/rdb/src/napi_result_set.cpp @@ -562,20 +562,18 @@ napi_value ResultSetProxy::GetSharedBlockAshmemFd(napi_env env, napi_callback_in } // namespace OHOS #if !defined(WINDOWS_PLATFORM) && !defined(MAC_PLATFORM) -EXTERN_C_START -__attribute__((visibility("default"))) napi_value NAPI_OHOS_Data_RdbJsKit_ResultSetProxy_NewInstance( - napi_env env, OHOS::NativeRdb::AbsSharedResultSet *resultSet) + +__attribute__((visibility("default"))) napi_value NewCInstance(napi_env env, + napi_value arg) asm("NAPI_OHOS_Data_RdbJsKit_ResultSetProxy_NewInstance"); +napi_value NewCInstance(napi_env env, std::shared_ptr resultSet) { - return OHOS::RdbJsKit::ResultSetProxy::NewInstance( - env, std::shared_ptr(resultSet)); + return OHOS::RdbJsKit::ResultSetProxy::NewInstance(env, resultSet); } -__attribute__((visibility("default"))) OHOS::NativeRdb::AbsSharedResultSet * -NAPI_OHOS_Data_RdbJsKit_ResultSetProxy_GetNativeObject(const napi_env &env, const napi_value &arg) +__attribute__((visibility("default"))) std::shared_ptr GetCObject(napi_env env, + napi_value arg) asm("NAPI_OHOS_Data_RdbJsKit_ResultSetProxy_GetNativeObject"); +std::shared_ptr GetCObject(napi_env env, napi_value arg) { - // the resultSet maybe release. - auto resultSet = OHOS::RdbJsKit::ResultSetProxy::GetNativeObject(env, arg); - return resultSet.get(); + return OHOS::RdbJsKit::ResultSetProxy::GetNativeObject(env, arg); } -EXTERN_C_END #endif \ No newline at end of file -- Gitee