diff --git a/interfaces/kits/js/src/mod_hash/module.cpp b/interfaces/kits/js/src/mod_hash/module.cpp index 5521fafe9532f2f8376fb94de31373629e58c2b1..0ffd91c0792fa0126d7e1efc38cd4e5957182f6d 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 f38664770aeb413f353fa76abf4b8f6d83344c23..50e5d91ca80b42da3a4aa0d2cc55740494d1f9bb 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 c2b968b23b62d5b70beea74e239999089a829402..937cf7684efcbe047d83110dface74159c6377f0 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