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" {...@@ -7517,13 +7517,13 @@ test "main" {
7517 {#header_close#}7517 {#header_close#}
75187518
7519 {#header_open|@export#}7519 {#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>
7521 <p>7521 <p>
7522 Creates a symbol in the output object file.7522 Creates a symbol in the output object file.
7523 </p>7523 </p>
7524 <p>7524 <p>
7525 This function can be called from a {#link|comptime#} block to conditionally export symbols.7525 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 and7526 When {#syntax#}identifier{#endsyntax#} is a function with the C calling convention and
7527 {#syntax#}options.linkage{#endsyntax#} is {#syntax#}Strong{#endsyntax#}, this is equivalent to7527 {#syntax#}options.linkage{#endsyntax#} is {#syntax#}Strong{#endsyntax#}, this is equivalent to
7528 the {#syntax#}export{#endsyntax#} keyword used on a function:7528 the {#syntax#}export{#endsyntax#} keyword used on a function:
7529 </p>7529 </p>
...@@ -7550,6 +7550,14 @@ export fn @"A function name that is a complete sentence."() void {}...@@ -7550,6 +7550,14 @@ export fn @"A function name that is a complete sentence."() void {}
7550 {#see_also|Exporting a C Library#}7550 {#see_also|Exporting a C Library#}
7551 {#header_close#}7551 {#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
7553 {#header_open|@fence#}7561 {#header_open|@fence#}
7554 <pre>{#syntax#}@fence(order: AtomicOrder){#endsyntax#}</pre>7562 <pre>{#syntax#}@fence(order: AtomicOrder){#endsyntax#}</pre>
7555 <p>7563 <p>