United States-English |
|
|
HP-UX Reference > Mmodel(4)TO BE OBSOLETEDHP-UX 11i Version 3: February 2007 |
|
NAMEmodel — HP-UX machine identification DESCRIPTIONThere 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
To port code to use inttypes.h instead of model.h, these are the corresponding definitions contained in intypes.h
Certain C preprocessor conditional compilation variables are defined to aid in implementation-dependent code. See cpp(1). |
Printable version | ||
|