Skip to content

Commit e8cf9db

Browse files
authored
Merge pull request #2898 from corob-msft/cr-ko-kr-989
Use keyword format to fix i18n issue in __thiscall
2 parents 7e0a5c3 + e9eb241 commit e8cf9db

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

docs/cpp/thiscall.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
11
---
22
title: "__thiscall"
3-
ms.date: "11/04/2016"
3+
ms.date: "05/22/2020"
44
f1_keywords: ["__thiscall", "__thiscall_cpp"]
55
helpviewer_keywords: ["__thiscall keyword [C++]"]
66
ms.assetid: a6a22dd2-0101-4885-b33b-22f6057965df
77
---
8-
# __thiscall
8+
# `__thiscall`
99

10-
**Microsoft Specific**
10+
The **Microsoft-specific** **`__thiscall`** calling convention is used on C++ class member functions on the x86 architecture. It's the default calling convention used by member functions that don't use variable arguments (`vararg` functions).
1111

12-
The **__thiscall** calling convention is used on member functions and is the default calling convention used by C++ member functions that do not use variable arguments. Under **__thiscall**, the callee cleans the stack, which is impossible for `vararg` functions. Arguments are pushed on the stack from right to left, with the **this** pointer being passed via register ECX, and not on the stack, on the x86 architecture.
12+
Under **`__thiscall`**, the callee cleans the stack, which is impossible for `vararg` functions. Arguments are pushed on the stack from right to left. The **`this`** pointer is passed via register ECX, and not on the stack.
1313

14-
One reason to use **__thiscall** is in classes whose member functions use `__clrcall` by default. In that case, you can use **__thiscall** to make individual member functions callable from native code.
14+
On ARM, ARM64, and x64 machines, **`__thiscall`** is accepted and ignored by the compiler. That's because they use a register-based calling convention by default.
1515

16-
When compiling with [/clr:pure](../build/reference/clr-common-language-runtime-compilation.md), all functions and function pointers are `__clrcall` unless specified otherwise. The **/clr:pure** and **/clr:safe** compiler options are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017.
16+
One reason to use **`__thiscall`** is in classes whose member functions use **`__clrcall`** by default. In that case, you can use **`__thiscall`** to make individual member functions callable from native code.
1717

18-
In releases before Visual Studio 2005, the **__thiscall** calling convention could not be explicitly specified in a program, because **__thiscall** was not a keyword.
18+
When compiling with [**`/clr:pure`**](../build/reference/clr-common-language-runtime-compilation.md), all functions and function pointers are **`__clrcall`** unless specified otherwise. The **`/clr:pure`** and **`/clr:safe`** compiler options are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017.
1919

20-
`vararg` member functions use the **__cdecl** calling convention. All function arguments are pushed on the stack, with the **this** pointer placed on the stack last
20+
`vararg` member functions use the **`__cdecl`** calling convention. All function arguments are pushed on the stack, with the **`this`** pointer placed on the stack last.
2121

22-
Because this calling convention applies only to C++, there is no C name decoration scheme.
22+
Because this calling convention applies only to C++, it doesn't have a C name decoration scheme.
2323

24-
On ARM and x64 machines, **__thiscall** is accepted and ignored by the compiler.
25-
26-
For non-static class functions, if the function is defined out-of-line, the calling convention modifier does not have to be specified on the out-of-line definition. That is, for class non-static member methods, the calling convention specified during declaration is assumed at the point of definition.
27-
28-
**END Microsoft Specific**
24+
When you define a non-static class member function out-of-line, specify the calling convention modifier only in the declaration. You don't have to specify it again on the out-of-line definition. The compiler uses the calling convention specified during declaration at the point of definition.
2925

3026
## See also
3127

32-
[Argument Passing and Naming Conventions](../cpp/argument-passing-and-naming-conventions.md)
28+
[Argument passing and naming conventions](../cpp/argument-passing-and-naming-conventions.md)

0 commit comments

Comments
 (0)