Skip to content

FFI tutorial: explicitly document how to define a function callable from C #10489

Closed
@pnkfelix

Description

@pnkfelix

I believe one is able to define C -> Rust function (Rust code callable from C) like this:

extern "C" fn foo(x: ::std::libc::c_int) -> ::std::libc::c_int { 2 * x }

but the construction above is at best only hinted at in the current tutorial-ffi.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-FFIArea: Foreign function interface (FFI)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions