C/C++ Programmer's Guide (G06.25+)

Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
13-92
SRLExports
SRLExports
The SRLExports pragma specifies that a definition of an external function or external
variable is exported from an SRL or a user library (a private shared run-time library).
This pragma sets the srl_export bit for the definition in the object file. When this
object file is linked, nld automatically adds any items which have this bit set to the
export list of the SRL. The SRLExports pragma is supported for TNS/R native C and
C++ only.
There is no default setting for this pragma.
Usage Guidelines
This pragma is valid only for TNS/R-targetted compilations.
The SRLExports pragma is only allowed in the source file. The SRLExports
pragma must appear directly before the declaration of the external function or
external variable. To have an effect, the corresponding definition must also be
within the same compilation unit.
Normally constants which have compile-time computable values are allocated in
the read-only data section. However, if the constant is exported by the
SRLExports pragma, the constant is allocated in the large data section. This is
because read-only data is not allowed to be exported by an SRL.
Pragma SRLExports cannot apply to static objects or static functions, or class
members.
Pragma SRLExportClassMembers can be used to export class members.
Example
#pragma srlexports
extern int foo (void) {
...
}
#pragma srlexports // Warning, Not applicable for static
// functions.
static int StaticFunction (void);
SRLExports