docs

您正在閱讀 v0.1.0 的文件。Nabi 0.1.0 已停止支援。 最新版本:v0.1.3 →

本頁尚未翻譯,以下為英文原文。

#E0025: unsupported ABI

An extern names an ABI Nabi does not support, or leaves it out. Write extern "C" (or "system" for the platform's system calls).

nabi
extern "fastcall" {
    fn abs(x: i32) -> i32;
}
error[E0025]: unsupported ABI `"fastcall"` (`"C"`, `"system"`, `"objc"`, or `"nabi"` for the runtime)
  --> main.nabi:1:1
   |
 1 | extern "fastcall" {
   | ^^^^^^

Write "C":

nabi
extern "C" {
    fn abs(x: i32) -> i32;
}
println(f"{unsafe { abs(-3) }}");
3

Related: E0084 invalid foreign-function use

Found a mistake? Edit this page on GitHub. Last updated