From d4d118d1f04b515899b815aee7e4eb634815b5eb Mon Sep 17 00:00:00 2001 From: 18721213663 Date: Wed, 12 Apr 2023 10:21:39 +0800 Subject: [PATCH] bugfix_fileapi_pluginname Signed-off-by: 18721213663 --- interfaces/kits/js/src/mod_hash/module.cpp | 15 ++++++++++++++- .../src/mod_securitylabel/securitylabel_napi.cpp | 15 ++++++++++++++- .../kits/js/src/mod_statvfs/statvfs_napi.cpp | 15 ++++++++++++++- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/interfaces/kits/js/src/mod_hash/module.cpp b/interfaces/kits/js/src/mod_hash/module.cpp index 5521fafe9..0ffd91c07 100644 --- a/interfaces/kits/js/src/mod_hash/module.cpp +++ b/interfaces/kits/js/src/mod_hash/module.cpp @@ -36,7 +36,20 @@ static napi_value Export(napi_env env, napi_value exports) return exports; } -NAPI_MODULE(hash, Export) +static napi_module _module = { + .nm_version = 1, + .nm_flags = 0, + .nm_filename = nullptr, + .nm_register_func = Export, + .nm_modname = "file.hash", + .nm_priv = ((void *)0), + .reserved = {0} +}; + +extern "C" __attribute__((constructor)) void RegisterModule(void) +{ + napi_module_register(&_module); +} } // namespace ModuleFileIO } // namespace FileManagement } // namespace OHOS \ No newline at end of file diff --git a/interfaces/kits/js/src/mod_securitylabel/securitylabel_napi.cpp b/interfaces/kits/js/src/mod_securitylabel/securitylabel_napi.cpp index f38664770..50e5d91ca 100644 --- a/interfaces/kits/js/src/mod_securitylabel/securitylabel_napi.cpp +++ b/interfaces/kits/js/src/mod_securitylabel/securitylabel_napi.cpp @@ -33,7 +33,20 @@ napi_value SecurityLabelExport(napi_env env, napi_value exports) return exports; } -NAPI_MODULE(securitylabel, SecurityLabelExport) +static napi_module _module = { + .nm_version = 1, + .nm_flags = 0, + .nm_filename = nullptr, + .nm_register_func = SecurityLabelExport, + .nm_modname = "file.securityLabel", + .nm_priv = ((void *)0), + .reserved = {0} +}; + +extern "C" __attribute__((constructor)) void RegisterModule(void) +{ + napi_module_register(&_module); +} } // namespace ModuleSecurityLabel } // namespace FileManagement } // namespace OHOS diff --git a/interfaces/kits/js/src/mod_statvfs/statvfs_napi.cpp b/interfaces/kits/js/src/mod_statvfs/statvfs_napi.cpp index c2b968b23..937cf7684 100644 --- a/interfaces/kits/js/src/mod_statvfs/statvfs_napi.cpp +++ b/interfaces/kits/js/src/mod_statvfs/statvfs_napi.cpp @@ -29,7 +29,20 @@ napi_value StatvfsExport(napi_env env, napi_value exports) return exports; } -NAPI_MODULE(statvfs, StatvfsExport) +static napi_module _module = { + .nm_version = 1, + .nm_flags = 0, + .nm_filename = nullptr, + .nm_register_func = StatvfsExport, + .nm_modname = "file.statvfs", + .nm_priv = ((void *)0), + .reserved = {0} +}; + +extern "C" __attribute__((constructor)) void RegisterModule(void) +{ + napi_module_register(&_module); +} } // namespace ModuleStatvfs } // namespace FileManagement } // namespace OHOS \ No newline at end of file -- Gitee