C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

Usage Guidelines
For the TNS/R native compilers, the SRL pragma can be entered only on the compiler RUN
command line. In the OSS environment, the pragma can be specified with the -Wsrl flag of
the c89 utility.
This pragma signifies that the code is being compiled to go into a SRL. This prevents the
compiler from using GP-relative addressing for global data. (Global data can be either extern
or static in scope.) This also causes the compiler to put anonymous literals into the read-only
data area.
Customers cannot use this pragma to build a public shared run-time library (SRL).
This pragma is not valid for the TNS/E native compilers.
SRLExportClassMembers
The SRLExportClassMembers pragma controls which members of a class are exported from
an SRL or a user library (a private shared run-time library). This pragma is supported for TNS/R
native C and C++ only.
SRLExportClassMembers srl_id exports
srl_id
is the name of the SRL that exports the class.
exports
PROTECTED | PUBLIC | * | (item_list)
item_list:
item | item_list , item
item:
is a member of the class.
This pragma has no default settings.
Usage Guidelines
The SRLExportClassMembers pragma is used to specify which members of a class are
exported from an SRL. Exporting a member function from an SRL means that the member
function definition is provided by the SRL. The SRL's clients should never have a copy (inlined
or non-inlined) of the function definition within the client's code. A client's call of the member
function will always resolve to calling the member function within the SRL.
The "same" SRLExportClassMembers pragma must appear in the class definition for both
the compilation of the SRL and the compilation of the SRL client. The results of inconsistencies
between the SRL and the SRL clients are undefined. When the SRLExportClassMembers
pragma is processed while compiling a client of the SRL, the compiler never inlines a call to
a member function exported by the SRL.
If srl_id matches the name given by #pragma SRLName, this pragma causes the compiler
to generate code for the exported definition, otherwise the compiler treats the definition as a
declaration.
The SRLExportClassMembers pragma must appear within the class definition. The class
definition must be in a global (file) scope.
Non-static data members cannot be exported.
The SRLExportClassMembers pragma applies only to methods introduced by the class,
not to methods inherited by the class.
242 Compiler Pragmas