mirror of
https://github.com/ziglang/zig.git
synced 2025-12-10 08:13:07 +00:00
langref: add docs for @extern
This commit is contained in:
parent
6cd71931cb
commit
41efdc73b9
@ -7517,13 +7517,13 @@ test "main" {
|
||||
{#header_close#}
|
||||
|
||||
{#header_open|@export#}
|
||||
<pre>{#syntax#}@export(target: anytype, comptime options: std.builtin.ExportOptions) void{#endsyntax#}</pre>
|
||||
<pre>{#syntax#}@export(identifier, comptime options: std.builtin.ExportOptions) void{#endsyntax#}</pre>
|
||||
<p>
|
||||
Creates a symbol in the output object file.
|
||||
</p>
|
||||
<p>
|
||||
This function can be called from a {#link|comptime#} block to conditionally export symbols.
|
||||
When {#syntax#}target{#endsyntax#} is a function with the C calling convention and
|
||||
When {#syntax#}identifier{#endsyntax#} is a function with the C calling convention and
|
||||
{#syntax#}options.linkage{#endsyntax#} is {#syntax#}Strong{#endsyntax#}, this is equivalent to
|
||||
the {#syntax#}export{#endsyntax#} keyword used on a function:
|
||||
</p>
|
||||
@ -7550,6 +7550,14 @@ export fn @"A function name that is a complete sentence."() void {}
|
||||
{#see_also|Exporting a C Library#}
|
||||
{#header_close#}
|
||||
|
||||
{#header_open|@extern#}
|
||||
<pre>{#syntax#}@extern(T: type, comptime options: std.builtin.ExternOptions) *T{#endsyntax#}</pre>
|
||||
<p>
|
||||
Creates a reference to an external symbol in the output object file.
|
||||
</p>
|
||||
{#see_also|@export#}
|
||||
{#header_close#}
|
||||
|
||||
{#header_open|@fence#}
|
||||
<pre>{#syntax#}@fence(order: AtomicOrder){#endsyntax#}</pre>
|
||||
<p>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user