Use conditional directives to isolate sections of platform
or release-specific code. This is useful when the number of lines
of release or platform-specific source code is small in relation
to the number of lines of common code. You could, for example, encapsulate
code that is different between the 32-bit and 64-bit HP-UX with
conditional directives.
The following example uses a #define
macro within a conditional directive:
#ifdef __LP64__ . . . /* LP64 specific code goes here */ #else . . . /* ILP32 specific code goes here */ #endif . . . /* Code common to both platforms goes here */ |