From ca483a21507f473b2564f580ac37d9801f722e23 Mon Sep 17 00:00:00 2001 From: zky Date: Thu, 23 Feb 2023 19:47:32 +0800 Subject: [PATCH] =?UTF-8?q?bugfix=20=E4=BF=AE=E5=A4=8Dnapi=E6=B3=A8?= =?UTF-8?q?=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zky --- .../kits/js/file_uri/file_uri_n_exporter.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/interfaces/kits/js/file_uri/file_uri_n_exporter.cpp b/interfaces/kits/js/file_uri/file_uri_n_exporter.cpp index eed41abaf..81118b23d 100644 --- a/interfaces/kits/js/file_uri/file_uri_n_exporter.cpp +++ b/interfaces/kits/js/file_uri/file_uri_n_exporter.cpp @@ -30,7 +30,20 @@ napi_value FileUriExport(napi_env env, napi_value exports) return exports; } -NAPI_MODULE(fileuri, FileUriExport) +static napi_module _module = { + .nm_version = 1, + .nm_flags = 0, + .nm_filename = nullptr, + .nm_register_func = FileUriExport, + .nm_modname = "file.fileuri", + .nm_priv = ((void *)0), + .reserved = {0} +}; + +extern "C" __attribute__((constructor)) void RegisterModule(void) +{ + napi_module_register(&_module); +} } // namespace ModuleFileUri } // namespace AppFileService } // namespace OHOS -- Gitee