Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX 64-bit Porting and Transition Guide: HP 9000 Computers > Chapter 5 Writing Portable Code

Using System-Specific Include Files

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Sometimes platform or release-specific source code differences are large. These differences can be isolated in different #include files and then be referenced by conditional directives.

Here is an example of including 32-bit or 64-bit type definitions depending on the word size of the machine:

#include <limits.h>
#if WORD_BIT > 32
. . . /* integers must be 64-bit */
# include "typedefs_64.h"
#else
. . . /* integers must be 32-bit */
# include "typedefs_32.h"
#endif /* 32-bit environment */
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1998 Hewlett-Packard Development Company, L.P.