4 ms·
I must admit I don't know. It does not appear to be necessary, I assume it's implied in one way or another for `no_mangle` extern functions. However I must al
by the_mitsuhiko 10y ago
I must admit I don't know. It does not appear to be necessary, I assume it's implied in one way or another for `no_mangle` extern functions. However I must also admit that I did not look into the exact mechanics.
I do know that if you bind to a function that is linked in that you need it.
- loeg 10y agoIt's for C++ consumers of C libraries. Doesn't matter for Python <-> Rust.
- the_mitsuhiko 10y agoThere is an extern C in Rust as well however which should enforce c calling conventions.
- loeg 10y agoRight, but `extern "C"` is for C++ programs using C library headers directly. Rust doesn't use C headers directly, I think, so it wouldn't need this kludge.
- tomjakubowski 10y agoI think you may be confused. The original commenter wasn't referring to use of 'extern "C"' in the C header file, but to its (lack of) use in the Rust source that defines those functions.
- deleted 10y ago[deleted]
- mbrubeck 10y ago`#[no_mangle]` is currently a bit overloaded; there's discussion of whether this is correct or not: https://internals.rust-lang.org/t/precise-semantics-of-no-mangle/4098 https://internals.rust-lang.org/t/precise-semantics-of-no-ma...