From a27a709e036dda16932e7470687f82cee6bdbd3c Mon Sep 17 00:00:00 2001 From: kolegovilya Date: Tue, 25 Feb 2025 17:02:23 +0300 Subject: [PATCH] add support fot int64 napi/ets --- interop/src/cpp/DeserializerBase.h | 5 +++++ interop/src/cpp/napi/convertors-napi.h | 4 ++-- interop/src/cpp/types/signatures.cc | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/interop/src/cpp/DeserializerBase.h b/interop/src/cpp/DeserializerBase.h index 80305d6c6..dae39fb28 100644 --- a/interop/src/cpp/DeserializerBase.h +++ b/interop/src/cpp/DeserializerBase.h @@ -564,6 +564,11 @@ inline void WriteToString(std::string *result, const InteropInt32* value) result->append(std::to_string(*value)); } template <> +inline void WriteToString(std::string *result, InteropUInt64 value) +{ + result->append(std::to_string(value)); +} +template <> inline void WriteToString(std::string *result, InteropInt64 value) { result->append(std::to_string(value)); diff --git a/interop/src/cpp/napi/convertors-napi.h b/interop/src/cpp/napi/convertors-napi.h index da58a5acd..ac0d8b203 100644 --- a/interop/src/cpp/napi/convertors-napi.h +++ b/interop/src/cpp/napi/convertors-napi.h @@ -574,8 +574,8 @@ napi_value makeString(napi_env env, const std::string& value); napi_value makeBoolean(napi_env env, KBoolean value); napi_value makeInt32(napi_env env, int32_t value); napi_value makeUInt32(napi_env env, uint32_t value); -napi_value makeInt64(napi_env env, int32_t value); -napi_value makeUInt64(napi_env env, uint32_t value); +napi_value makeInt64(napi_env env, int64_t value); +napi_value makeUInt64(napi_env env, uint64_t value); napi_value makeFloat32(napi_env env, float value); napi_value makePointer(napi_env env, void* value); napi_value makeVoid(napi_env env); diff --git a/interop/src/cpp/types/signatures.cc b/interop/src/cpp/types/signatures.cc index 8fc6b3817..18833dfdb 100644 --- a/interop/src/cpp/types/signatures.cc +++ b/interop/src/cpp/types/signatures.cc @@ -42,6 +42,7 @@ KOALA_INTEROP_TYPEDEF(func, lang, "int", "I", "int") \ KOALA_INTEROP_TYPEDEF(func, lang, "KInt", "I", "int") \ KOALA_INTEROP_TYPEDEF(func, lang, "KUInt", "I", "int") \ + KOALA_INTEROP_TYPEDEF(func, lang, "KLong", "J", "long") \ KOALA_INTEROP_TYPEDEF(func, lang, "OH_Int32", "I", "int") \ KOALA_INTEROP_TYPEDEF(func, lang, "OH_Int64", "J", "long") \ KOALA_INTEROP_TYPEDEF(func, lang, "Ark_Int32", "I", "int") \ -- Gitee