Commit 41efdc73b9

Andrew Kelley <andrew@ziglang.org>
2021-04-23 01:24:14
langref: add docs for `@extern`
1 parent 6cd7193
Changed files (1)
doc/langref.html.in
@@ -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>