mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 19:08:15 +00:00
![]()
Some checks are pending
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
Bumped versions for 2.4.3 Please ensure: - [x] Crate versions are bumped correctly - [x] Releases.md is updated correctly (think relevancy and remove reverts) To make edits to this PR: ```shell git fetch upstream release_2_4.3 && git checkout -b release_2_4.3 upstream/release_2_4.3 ``` cc @crowlKats --------- Signed-off-by: Leo Kettmeir <64b2b6d@kettmeir.dev> Co-authored-by: crowlKats <crowlKats@users.noreply.github.com> Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com> |
||
---|---|---|
.. | ||
Cargo.toml | ||
lib.rs | ||
README.md | ||
symbol_exports.json |
napi_sym
A proc_macro for Deno's Node-API implementation. It does the following things:
- Marks the symbol as
#[no_mangle]
and rewrites it asunsafe extern "C" $name
. - Asserts that the function symbol is present in
symbol_exports.json
. - Maps
deno_napi::Result
to rawnapi_result
.
use deno_napi::Env;
use deno_napi::Error;
use deno_napi::Result;
use deno_napi::napi_value;
#[napi_sym::napi_sym]
fn napi_get_boolean(
env: *mut Env,
value: bool,
result: *mut napi_value,
) -> Result {
let _env: &mut Env = env.as_mut().ok_or(Error::InvalidArg)?;
// *result = ...
Ok(())
}
symbol_exports.json
A file containing the symbols that need to be put into the executable's dynamic symbol table at link-time.
This is done using /DEF:
on Windows, -exported_symbol,_
on macOS and
--export-dynamic-symbol=
on Linux. See cli/build.rs
.
On Windows, you need to generate the .def
file by running
tools/napi/generate_symbols_lists.js
.