#pragma alias

From RAD Studio
Jump to: navigation, search

Go Up to Pragma Directives Overview Index

Syntax (See Pseudo-grammar)

#pragma alias "aliasName" = "substituteName"

Description

The #pragma alias indicates the linker that two identifier names are equivalent. Both the identifiers must be enclosed in quotation marks, otherwise a W8086 Incorrect use of pragma alias "aliasName"="substituteName" (C++) warning is output.

The aliases are now managed in separate units, by two .obj files, one for Unicode and one for non-Unicode. Both of these .obj files are part of the VCL library.

The aliasName and the substituteName are injected into their corresponding .obj file exactly as they are written inside the quotation marks. The linker finds all the references to aliasName and links them to the substituteName.

Note: The .hpp files generated from Delphi code use the #pragma alias for managing identifiers that are mangled differently in Delphi and C++Builder.