2
, C ++ compile-time function (non-class member function) Name ModificationWhen the function is called with _ cdecl, the compiler performs the following operations: 1. Use? Start of the function name, followed by the function name; 2. the function name starts with the @ ya mark, followed by the return value and parameter table. 3. when the return value or parameter of a function is irrelevant to the C ++ class, the return value and the following column code of the parameter table are: B: constd: chare: Unsigned charf: shortg: Unsigned shorth: Inti: unsigned intj: longk: Unsigned longm: floatn: double_n: boolpa: pointer (*, the following code indicates the pointer type. If the pointer of the same type appears consecutively, it is replaced by 0, A 0 represents a duplicate.) Pb: const pointer AA: Reference (&) AB: const reference U: class or struct V: interface (Interface) W4: enumx: the void4, @ ya identifiers are followed by the return value type of the function, followed by the parameter data type, and the pointer identifiers are prior to the data type they refer. When the return value or parameter of a function is irrelevant to the C ++ class, the processing conforms to this rule; otherwise, the processing follows rules 5 and 6; 5. When the return value of a function is a class or a class with the const nature, the return value is named :? A /? B + V + class name + @ (without the plus sign ). When the return value of a function is a pointer/reference of a class or a pointer/reference of a class with the const nature, the return value is named: PA/AA or Pb/AB + V + class name + @ (without the plus sign); 6. When the function parameter is a class, if the class used by this parameter has appeared (that is, the class used by the function return value is the same or the class used by the previous parameter), the parameter Type format is: V + 1 + @ (without the plus sign ). If the class used by this parameter does not appear, the format of this parameter is V + class name + @ (without the plus sign ). When the function parameter is a class pointer/reference or a const pointer/reference, the parameter Type format is based on the above format, and the identifier (PA/AA or Pb/AB) that represents the pointer/reference type or the const pointer/reference type is added before V ); 7. mark the end of the entire name with @ Z after the parameter table. If this function has no parameter, it ends with Z. When the function is called with _ stdcall, the rules used by the compiler are the same as those described in the _ cdecl call Convention, except that the start ID of the parameter table is changed from @ ya to @ YG. When the function is called with _ fastcall, the rules for the compiler's work are the same as the _ cdecl call Convention above, except that the start mark of the parameter table is changed from @ ya to @ Yi.
3. Name modification for C ++ compiling class and its member functionsOnly the _ cdecl call conventions can be used for exported C ++ classes. During compilation, the compiler processes the C ++ class. For example, class _ declspec (dllexport) myclass will be processed as class myclass & myclass: Operator = (class myclass const &). When the C ++ compiler modifies the name of the C ++ class, the compiler performs the following work: 1. Use? Start of the function name, followed? 4 + class names; 2. the class name is followed by the @ Qae identifier, which is fixed for the export class; 3. @ Qae followed by aav0 @ abv0 @, that is, reference type identifier AA + V + 0 (repeated Class Identifier) + @ (without the plus sign) and const reference AB + V + 0 (repeated Class Identifier) + @ (without the plus sign); 4. end with @ Z to mark the entire name. You can use different call conventions for the member functions (non-constructor and destructor) in the exported C ++ class. When the member functions in the exported C ++ class are called using _ cdecl, the compiler performs the following work: 1. Use? Start of the function name, followed by the function name + @ + class name (without the plus sign); 2. start with @ Qae, followed by the return value and parameter table; 3. when the return value or parameter of a function is irrelevant to the C ++ class, the return value and the following column code of the parameter table are: B: constd: chare: Unsigned charf: shortg: Unsigned shorth: Inti: unsigned intj: longk: Unsigned longm: floatn: double_n: boolpa: pointer (*, the following code indicates the pointer type. If the pointer of the same type appears consecutively, it is replaced by 0, A 0 represents a duplicate.) Pb: const pointer AA: Reference (&) AB: const reference U: class or struct V: interface (Interface) W4: enumx: the void4 and @ Qae identifiers are followed by the return value type of the function, followed by the parameter data type, and the pointer identifiers are prior to the data type they refer. When the return value or parameter of a function is irrelevant to the C ++ class, the processing conforms to this rule; otherwise, the processing follows rules 5 and 6; 5. When the return value of a function is the current class or the current class with the const nature, the return value is named :? A or? B + V + 1 + @ (without the plus sign ). When the return value of a function is a pointer/reference of the current class or a pointer/reference of the current class with the const nature, the return value is named: PA/AA or Pb/AB + V + 1 + @ (without the plus sign); 6. When the return value of a function is a class or a class with the const nature, the returned value is named :? A /? B + V + class name + @ (without the plus sign ). When the return value of a function is a pointer/reference of a class or a pointer/reference of a class with the const nature, the return value is named: PA/AA or Pb/AB + V + class name + @ (without the plus sign); 7. When the function parameter is a class, and the class used by this parameter has appeared (that is, the class to be exported, the class used for the function return value, or the class used for the previous parameter), the parameter type is in the format of V + 1 + @ (without the plus sign ). If the class used by this parameter is not the class to be exported, the format of this parameter is V + class name + @ (without the plus sign ). When the function parameter is a class pointer/reference or a const pointer/reference, the parameter Type format is based on the above format, and the identifier (PA/AA or Pb/AB) that represents the pointer/reference type or the const pointer/reference type is added before V ); 8. mark the end of the name with @ Z after the parameter table. If this function has no parameter, it ends with Z. When the function is called with _ stdcall, the rules used by the compiler are the same as those described in the _ cdecl call Convention, except that the start ID of the parameter table is changed from @ ya to @ YG. When the function is called with _ fastcall, the rules for the compiler's work are the same as the _ cdecl call Convention above, except that the start mark of the parameter table is changed from @ ya to @ Yi.
4. Name modification when compiling and exporting data in C ++Only the _ cdecl call Convention is used for the exported data. When the C ++ compiler modifies the name of the C ++ class, the compiler performs the following work: 1. Use? Mark the start of the data, followed by the Data name; 2. the data name starts with the @ 3 identifier, followed by the data type. 3. when the data type is not related to the C ++ class, the following column code of the data type is B: constd: chare: Unsigned charf: shortg: Unsigned shorth: Inti: Unsigned intj: longk: unsigned longm: floatn: double_n: boolpa: pointer: const pointer AA: Reference (&) AB: const reference U: class or struct V: interface (Interface) W4: enumx: void4. if the data type is a class, the data type is named V + class name + @ (without the plus sign ). When the data type is the pointer/reference of the current class or the pointer/reference of the current class with the const nature, the data type is named: PA/AA or Pb/AB + V + class name + @ (without the plus sign); 5. finally, if the data type is const, the modifier name ends with B. If the data type is non-const, the modifier name ends with.