authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-22 16:24:14-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-22 16:24:14-07:00
log41efdc73b9a57dfcc57474310c64724f58a95493
treeb3d56011775d2ceca164322af2b436fc5fe8c6d5
parent6cd71931cb43c775864553b5a232709fbc771689

langref: add docs for `@extern`


1 files changed, 10 insertions(+), 2 deletions(-)

doc/langref.html.in+10-2
......@@ -7517,13 +7517,13 @@ test "main" {
75177517 {#header_close#}
75187518
75197519 {#header_open|@export#}
7520 <pre>{#syntax#}@export(target: anytype, comptime options: std.builtin.ExportOptions) void{#endsyntax#}</pre>
7520 <pre>{#syntax#}@export(identifier, comptime options: std.builtin.ExportOptions) void{#endsyntax#}</pre>
75217521 <p>
75227522 Creates a symbol in the output object file.
75237523 </p>
75247524 <p>
75257525 This function can be called from a {#link|comptime#} block to conditionally export symbols.
7526 When {#syntax#}target{#endsyntax#} is a function with the C calling convention and
7526 When {#syntax#}identifier{#endsyntax#} is a function with the C calling convention and
75277527 {#syntax#}options.linkage{#endsyntax#} is {#syntax#}Strong{#endsyntax#}, this is equivalent to
75287528 the {#syntax#}export{#endsyntax#} keyword used on a function:
75297529 </p>
......@@ -7550,6 +7550,14 @@ export fn @"A function name that is a complete sentence."() void {}
75507550 {#see_also|Exporting a C Library#}
75517551 {#header_close#}
75527552
7553 {#header_open|@extern#}
7554 <pre>{#syntax#}@extern(T: type, comptime options: std.builtin.ExternOptions) *T{#endsyntax#}</pre>
7555 <p>
7556 Creates a reference to an external symbol in the output object file.
7557 </p>
7558 {#see_also|@export#}
7559 {#header_close#}
7560
75537561 {#header_open|@fence#}
75547562 <pre>{#syntax#}@fence(order: AtomicOrder){#endsyntax#}</pre>
75557563 <p>