annotation CallConvention

Overview

Indicates the calling convention of a fun or an entire lib definition.

It expects a single positional argument with the name of the calling convention as StringLiteral.

lib LibFoo
  @[CallConvention("X86_StdCall")]
  fun foo : Int32
end

The list of valid call conventions is:

When applied directly to a lib, it sets the default calling convention for every fun declared within it that doesn't specify its own.

See the LLVM documentation for more details.

NOTE The Crystal book has a section about Built-in Annotations: CallConvention.

Defined in:

annotations.cr