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 1ae73e1ee5ad1cecad19c0e4cb8d081f1cfbb08e..4b5f51177b594e6cde6635ad1480e18caeb506aa 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 3ece7c040a46d51f31527ce5afe382f10b703e78..80322c3535d697e9d63723bfd4d2973046467d60 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