Solaris 64-bit Developer's Guide

Headers

A single set of system headers supports both 32-bit and 64-bit compilation environments. You do not need to specify a different include path for the 64-bit compilation environment.

To better understand the changes made to the headers for support of the 64-bit environment, you should understand the various definitions in the header <sys/isa_defs.h>. This header contains a group of well known #defines and sets these for each instruction set architecture. Inclusion of <sys/types.h> automatically includes <sys/isa_defs.h>.

The symbols in the following table are defined by the compilation environment:

__sparcIndicates any of the SPARC family of processor architectures. This includes SPARC V7, SPARC V8, and SPARC V9 architectures. The symbol sparc is a deprecated historical synonym for __sparc.
__sparcv8Indicates the 32-bit SPARC V8 architecture as defined by Version 8 of the SPARC Architecture Manual.
__sparcv9Indicates the 64-bit SPARC V9 architecture as defined by Version 9 of the SPARC Architecture Manual.
__i386 This symbol is generic for all processors implementing the Intel 386 instruction set or a superset of it. This includes all members of the 386, 486, and Pentium family of processors.

The symbols __sparcv8 and __sparcv9 are mutually exclusive and are only relevant when the symbol __sparc is defined.

The following symbols are derived from some combination of the symbols above being defined:

_ILP32The data model where sizes of int, long, and pointer are all 32 bits.
_LP64The data model where sizes of long and pointer are all 64 bits.

The symbols _ILP32 and _LP64 are also mutually exclusive.

If writing completely portable code is not possible, and specific 32-bit versus 64-bit code is required, make the code conditional using _ILP32 or _LP64. This makes the compilation environment machine independent and maximizes the portability of the application to all 64-bit platforms.