model(4) model(4)
TO BE OBSOLETED
NAME [Toc] [Back]
model - HP-UX machine identification
SYNOPSIS [Toc] [Back]
#include <model.h>
DESCRIPTION [Toc] [Back]
There are certain inevitable distinctions between HP-UX
implementations due to hardware differences. Where such distinctions
exist, conditional compilation or other definitions can be used to
isolate the differences. Flags and typedefs to resolve these
distinctions are collected in the <model.h> header file which contains
constants identifying various HP-UX implementations.
For example, header file model.h contains the following constants
whose values are defined in <sys/magic.h>:
#define HP_S_500 HP9000_ID
#define HP_S_200 HP98x6_ID
#define HP_S_300 CPU_HP_MC68020
#define HP_S_800 CPU_PA_RISC1_0
#define HP_S_700 CPU_PA_RISC1_1
Other such constants are added as appropriate when HP-UX extends to
other machines in subsequent releases.
In addition, model.h has a statement defining the preprocessor
constant MYSYS to represent the specific implementation for which
compilation is desired. MYSYS is always equal to one of the constants
above.
Conditional compilation can be used to adapt a single file for
execution on more than one HP-UX implementation if the file contains
implementation- or architecture-dependent features. For example, the
code segment:
#if MYSYS==HP_S_400
<statements>
#endif
causes statements following the if statement to be compiled only if
the system processor is an HP 9000 Series 400 machine.
model.h also contains typedefs for several predefined types to enhance
portability of certain types of code and files.
These typedef declarations have been replaced by the header file
inttypes.h
int8, u_int8 Signed and unsigned 8-bit integral
type.
Hewlett-Packard Company - 1 - HP-UX 11i Version 2: August 2003
model(4) model(4)
TO BE OBSOLETED
int16, u_int16 Signed and unsigned 16-bit integral
type.
int32, u_int32 Signed and unsigned 32-bit integral
type.
machptr, u_machptr Signed and unsigned integral type
large enough to hold a pointer.
To port code to use inttypes.h instead of model.h, these are the
corresponding definitions contained in intypes.h
int8_t, uint8_t Signed and unsigned 8-bit integral
types.
int16_t, uint16_t Signed and unsigned 16-bit integral
types.
int32_t, uint32_t Signed and unsigned 32-bit integral
types.
intptr_t, uintptr_T Signed and unsigned integral large
enough to hold a pointer.
Certain C preprocessor conditional compilation variables are defined
to aid in implementation-dependent code. See cpp(1).
SEE ALSO [Toc] [Back]
cc(1), cpp(1), inttypes(5), magic(4).
Hewlett-Packard Company - 2 - HP-UX 11i Version 2: August 2003 [ Back ] |