Skip to content

Commit 0275c80

Browse files
authored
Merge pull request #2000 from ehuss/extern-block-restrictions
Specify the target limits for target-specific ABIs
2 parents d01f991 + 2b4018d commit 0275c80

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

src/items/external-blocks.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -111,49 +111,51 @@ r[items.extern.abi.standard]
111111
The following ABI strings are supported on all platforms:
112112

113113
r[items.extern.abi.rust]
114-
* `unsafe extern "Rust"` -- The default ABI when you write a normal `fn foo()` in any
115-
Rust code.
114+
* `unsafe extern "Rust"` --- The default ABI when you write a normal `fn foo()` in any Rust code.
116115

117116
r[items.extern.abi.c]
118-
* `unsafe extern "C"` -- This is the same as `extern fn foo()`; whatever the default
119-
your C compiler supports.
117+
* `unsafe extern "C"` --- This is the same as `extern fn foo()`; whatever the default your C compiler supports.
120118

121119
r[items.extern.abi.system]
122-
* `unsafe extern "system"` -- Usually the same as `extern "C"`, except on Win32, in
123-
which case it's `"stdcall"`, or what you should use to link to the Windows
124-
API itself
120+
* `unsafe extern "system"` --- Usually the same as `extern "C"`, except on Win32, in which case it's `"stdcall"`, or what you should use to link to the Windows API itself.
125121

126122
r[items.extern.abi.unwind]
127-
* `extern "C-unwind"` and `extern "system-unwind"` -- identical to `"C"` and `"system"`, respectively, but with [different behavior][unwind-behavior] when the callee unwinds (by panicking or throwing a C++ style exception).
123+
* `extern "C-unwind"` and `extern "system-unwind"` --- Identical to `"C"` and `"system"`, respectively, but with [different behavior][unwind-behavior] when the callee unwinds (by panicking or throwing a C++ style exception).
128124

129125
r[items.extern.abi.platform]
130126
There are also some platform-specific ABI strings:
131127

132128
r[items.extern.abi.cdecl]
133-
* `unsafe extern "cdecl"` -- The default for x86\_32 C code.
129+
* `unsafe extern "cdecl"` --- The default for x86_32 C code.
130+
* Only available on x86_32 targets.
134131

135132
r[items.extern.abi.stdcall]
136-
* `unsafe extern "stdcall"` -- The default for the Win32 API on x86\_32.
133+
* `unsafe extern "stdcall"` --- The default for the Win32 API on x86_32.
134+
* Only available on x86_32 targets.
137135

138136
r[items.extern.abi.win64]
139-
* `unsafe extern "win64"` -- The default for C code on x86\_64 Windows.
137+
* `unsafe extern "win64"` --- The default for C code on x86_64 Windows.
138+
* Only available on x86_64 targets.
140139

141140
r[items.extern.abi.sysv64]
142-
* `unsafe extern "sysv64"` -- The default for C code on non-Windows x86\_64.
141+
* `unsafe extern "sysv64"` --- The default for C code on non-Windows x86_64.
142+
* Only available on x86_64 targets.
143143

144144
r[items.extern.abi.aapcs]
145-
* `unsafe extern "aapcs"` -- The default for ARM.
145+
* `unsafe extern "aapcs"` --- The default for ARM.
146+
* Only available on ARM32 targets.
146147

147148
r[items.extern.abi.fastcall]
148-
* `unsafe extern "fastcall"` -- The `fastcall` ABI -- corresponds to MSVC's
149-
`__fastcall` and GCC and clang's `__attribute__((fastcall))`
149+
* `unsafe extern "fastcall"` --- The `fastcall` ABI --- corresponds to MSVC's `__fastcall` and GCC and clang's `__attribute__((fastcall))`.
150+
* Only available on x86_32 targets.
150151

151152
r[items.extern.abi.thiscall]
152-
* `unsafe extern "thiscall"` -- The default for C++ member functions on x86\_32 MSVC -- corresponds to MSVC's
153-
`__thiscall` and GCC and clang's `__attribute__((thiscall))`
153+
* `unsafe extern "thiscall"` --- The default for C++ member functions on x86_32 MSVC --- corresponds to MSVC's `__thiscall` and GCC and clang's `__attribute__((thiscall))`.
154+
* Only available on x86_32 targets.
154155

155156
r[items.extern.abi.efiapi]
156-
* `unsafe extern "efiapi"` -- The ABI used for [UEFI] functions.
157+
* `unsafe extern "efiapi"` --- The ABI used for [UEFI] functions.
158+
* Only available on x86 and ARM targets (32bit and 64bit).
157159

158160
r[items.extern.abi.platform-unwind-variants]
159161
Like `"C"` and `"system"`, most platform-specific ABI strings also have a [corresponding `-unwind` variant][unwind-behavior]; specifically, these are:

0 commit comments

Comments
 (0)