Open System Services Porting Guide (G06.24+, H06.03+)

Table Of Contents
Migrating Guardian Applications to the OSS
Environment
Open System Services Porting Guide520573-006
8-7
Include File Search Order
The use of header files is optional (but strongly recommended) for programs that
contain Guardian modules exclusively. However, using header files is required for
mixed-module programs: for example, when an OSS module is bound into a Guardian
program. If compilation is done without using header files, the linker cannot correctly
resolve external references to Guardian and OSS functions.
Include File Search Order
In the Guardian environment, the SSV pragma specifies a search list of subvolumes for
files specified in the #include directives. In the OSS environment, the -I flag with
the c89 utility specifies a search list of directories for files specified in #include
directives. Refer to the c89(1) reference page either online or in the Open System
Services Shell and Utilities Reference Manuall for the details.
Using Pragmas
Some of the compiler pragmas used in Guardian C or C++ programs do not apply to
programs compiled in the OSS environment; they are ignored or generate an error
when the c89 utility is used.
You can remove these pragmas from the source files if you compile with the c89 utility:
Preprocessor Symbols
The native and TNS C compilers provide three predefined preprocessor symbols:
__TANDEM, __INT32, and __XMEM.
You can use __TANDEM to increase the portability of your C programs. (Enclose
system-dependent source text in a section that uses #ifdef or #ifndef directives to
test for the existence of __TANDEM.)
For the TNS environment, __INT32 (for int defined as 32 bits) is defined by the C
compiler when the WIDE pragma is present; __XMEM (for the large-memory model) is
defined by the C compiler when the XMEM pragma is present. For the native
environment, these two symbols are always defined.
Note. The native C compilers can be directed to accept C source files conforming to Kernigan
and Ritchie (K&R) C or Common C in addition to ISO/ANSI C. However, HP does not provide a
complete set of header files that conform to K&R C. The user must modify existing header files
or obtain files from another source to compile K&R C source files.
RUNNABLE Generate executable object file.
SEARCH Search object file to resolve external references (used with RUNNABLE).
SSV Specify list of search subvolumes for files in #include directives.
NOXMEM Select small memory model (TNS only).
NOWIDE Select 16-bit data model (TNS only).