Checks for Type and Structure Definitions

Now let's consider how we might test for system- or compiler-provided type and structure definitions. When writing cross-platform networking software, one quickly learns that the data sent between machines needs to be formatted in a way that doesn't depend on a particular CPU or operating system architecture. Some systems' native integer sizes are 32 bits, while others' are 64 bits. Some systems store integer values in memory and on disk from least-significant byte to most-significant byte, while others do the reverse.

Let's consider an example. When using C-language structures to format network messages, one of the first roadblocks you'll encounter is the lack of basic C-language types that have the same ...

Get Autotools now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.