Many of the Microsoft-specific keywords can be used to modify declarators to form derived types. These keywords are shown in Table B.1. (For more information about declarators, see Chapter 7.)
Table B.1 Microsoft-Specific Keywords
Keyword |
Meaning |
Used to Form Derived Types? |
__asm | Insert the following assembly-language code. | No | |
__based | The name that follows declares a 16-bit offset to the base contained in the declaration.1 | Yes | |
__cdecl | The name that follows uses the C naming and calling conventions., Yes | ||
__emit | Emit the following byte exactly (only legal inside __asm blocks).2 | No | |
__export | The name that follows is marked with the EXPORT attribute., Yes | ||
__far | The name that follows declares an object or function that uses segmented addressing.2 | Yes | |
__fastcall | The name that follows declares a function that uses registers, when available, instead of the stack for argument passing., Yes | ||
__fortran | The name that follows uses the FORTRAN/Pascal naming and calling conventions.2 | Yes | |
__huge | The name that follows declares an object or function that uses segmented addressing.2 | Yes | |
__interrupt | The name that follows declares a function that is an interrupt service routine. | Yes | |
__loadds | The name that follows declares a function that must load the DS register as part of the entry sequence.2 | Yes | |
__near | The name that follows declares a name that represents a 16-bit offset into DGROUP.4 | Yes | |
__pascal | The name that follows uses the FORTRAN/Pascal naming and calling conventions.2 | Yes | |
__saveregs | The name that follows declares a function. The function entry sequence saves the values in all registers.2 | Yes | |
__segment | The name that follows specifies a segment value—for use with based pointers and objects. | Yes | |
__segname | Built-in conversion function that takes the name of a segment and returns a value of type __segment—for use with based pointers and objects. | Yes | |
__self | Specifies the name of the segment in which a based pointer is stored—for use with based pointers and objects. | Yes | |
__stdcall | The name that follows specifies a function that observes the standard calling convention.3 | Yes |
1Only based-on-pointer form allowed in 32-bit target compilations. In such compilations, they represent a 32-bit offset to a 32-bit base.
2Illegal in 32-bit compilations.
3Legal only in 32-bit target compilations.
4The __near keyword is allowed in 32-bit target compilations, but it is ignored.
The following sections discuss the syntactic usage and semantic meaning of the keywords in Table B.1.