WolframResearch / wstp-rs

Rust bindings to the Wolfram Symbolic Transport Protocol (WSTP)
Apache License 2.0
21 stars 3 forks source link

bugfix: Fix use of i8 instead of c_char causing build failures on Linux #45

Closed ConnorGray closed 1 year ago

ConnorGray commented 1 year ago

The code mistakenly assumed that c_char was i8 on all Rust platforms, but that is not true on Linux, so this is causing type mismatch errors at build time on Linux.

(This mistake of mine was presumably reinforced by Rust issue #15823, which is an issue with rustdoc rendering some type aliases in function signatures as the pointed-to type and not by the alias name, which--among other effects--causes CStr::from_raw() and CString::into_raw() to show i8 in their type signatures instead of c_char.)

See also: https://github.com/rust-lang/rust/issues/15823