1 Star 0 Fork 9

zhuzhihui7/third_party_decimal.js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
decimal.cpp 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
liujia178 提交于 2024-05-09 09:43 . fix decimal ABCcode and install path
/*!
* decimal.js v10.4.3
* An arbitrary-precision Decimal type for JavaScript.
* https://github.com/MikeMcl/decimal.js
* Copyright (c) 2024 Huawei Device Co., Ltd.
* MIT Licence
*/
#include "native_engine/native_engine.h"
extern const char _binary_decimal_mjs_start[];
extern const char _binary_decimal_mjs_end[];
extern const char _binary_decimal_abc_start[];
extern const char _binary_decimal_abc_end[];
// Napi get mjs code function
extern "C" __attribute__((visibility("default")))
void NAPI_arkts_math_Decimal_GetMJSCode(const char **buf, int *buflen)
{
if (buf != nullptr) {
*buf = _binary_decimal_mjs_start;
}
if (buflen != nullptr) {
*buflen = _binary_decimal_mjs_end - _binary_decimal_mjs_start;
}
}
// Napi get abc code function
extern "C" __attribute__((visibility("default")))
void NAPI_arkts_math_Decimal_GetABCCode(const char **buf, int *buflen)
{
if (buf != nullptr) {
*buf = _binary_decimal_abc_start;
}
if (buflen != nullptr) {
*buflen = _binary_decimal_abc_end - _binary_decimal_abc_start;
}
}
/*
* Module define
*/
static napi_module DecimalModule = {
.nm_filename = nullptr,
.nm_modname = "arkts.math.Decimal",
};
extern "C" __attribute__((constructor)) void DecimalRegisterModule(void)
{
napi_module_register(&DecimalModule);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhuzhihui7/third_party_decimal.js.git
[email protected]:zhuzhihui7/third_party_decimal.js.git
zhuzhihui7
third_party_decimal.js
third_party_decimal.js
master

搜索帮助