The #pragma map directive tells the compiler that all references to an identifier are to be converted to "name".
where:
identifier A name of a data object or a nonoverloaded function with external linkage.
If the identifier is the name of an overloaded function or a member function, there is a risk that the pragma will override the compiler-generated names. This will create problems during linking.
function_signature A name of a function or operator with internal linkage. The name can be qualified. name The external name that is to be bound to the given object, function, or operator.
Specify the mangled name if linking into a C++ name (a name that will have C++ linkage signature, which is the default signature in C++). See Example 4, in the Examples section below.
You should not use #pragma map to map the following:
The directive can appear anywhere in the program. The identifiers appearing in the directive, including any type names used in the prototype argument list, are resolved as though the directive had appeared at file scope, independent of its actual point of occurrence.
Example 1
int funcname1() { return 1; } #pragma map(func , "funcname1") /* maps func to funcname1 */ int main() { return func(); /* no function prototype needed in C */ }
Example 2
extern "C" int funcname1() { return 0; } extern "C" int func(); //function prototypes needed in C++ #pragma map(func , "funcname1") // maps ::func to funcname1 int main() { return func(); }
Example 3
#pragma map(foo, "bar") int foo(); //function prototypes needed in C++ int main() { return foo(); } extern "C" int bar() {return 7;}