Formatted C++ Files According to the clang-format file. (#33158)
This commit is contained in:
parent
ebfcf89a0b
commit
86e746c36b
2 changed files with 9 additions and 6 deletions
|
@ -1,2 +1 @@
|
|||
extern "C"
|
||||
void foo() { }
|
||||
extern "C" void foo() {}
|
|
@ -8,22 +8,26 @@ napi_value TestLoadLibrary(napi_env env, napi_callback_info info) {
|
|||
napi_value argv;
|
||||
napi_status status;
|
||||
status = napi_get_cb_info(env, info, &argc, &argv, NULL, NULL);
|
||||
if (status != napi_ok) napi_fatal_error(NULL, 0, NULL, 0);
|
||||
if (status != napi_ok)
|
||||
napi_fatal_error(NULL, 0, NULL, 0);
|
||||
|
||||
char lib_path[256];
|
||||
status = napi_get_value_string_utf8(env, argv, lib_path, 256, NULL);
|
||||
if (status != napi_ok) napi_fatal_error(NULL, 0, NULL, 0);
|
||||
if (status != napi_ok)
|
||||
napi_fatal_error(NULL, 0, NULL, 0);
|
||||
|
||||
uv_lib_t lib;
|
||||
auto uv_status = uv_dlopen(lib_path, &lib);
|
||||
if (uv_status == 0) {
|
||||
napi_value result;
|
||||
status = napi_get_boolean(env, true, &result);
|
||||
if (status != napi_ok) napi_fatal_error(NULL, 0, NULL, 0);
|
||||
if (status != napi_ok)
|
||||
napi_fatal_error(NULL, 0, NULL, 0);
|
||||
return result;
|
||||
} else {
|
||||
status = napi_throw_error(env, NULL, uv_dlerror(&lib));
|
||||
if (status != napi_ok) napi_fatal_error(NULL, 0, NULL, 0);
|
||||
if (status != napi_ok)
|
||||
napi_fatal_error(NULL, 0, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue