16.3.7 Type Definitions

All type definitions using C base types are translated directly. For example, H2INC converts the C type definitions

typedef int INTEGER;

typedef float FLOAT;

to these MASM forms:

INTEGER TYPEDEF SWORD

FLOAT TYPEDEF REAL4

Pointer types are converted in a similar fashion. The following declarations

typedef int *PINT

typedef int **PINT

typedef int far *PINT

become (respectively)

PINT TYPEDEF PTR SWORD

PINT TYPEDEF PTR PTR SWORD

PINT TYPEDEF FAR PTR SWORD

Summary: Addressing mode determines pointer size.

The number of bytes allocated for the pointer is set by the addressing mode you have selected unless if is specifically overridden in the type definition.

C statements using typedef which convert to a type with the same name as the type do not generate errors, but are not converted. For example, H2INC does not convert

typedef int SWORD

typedef unsigned char BYTE

since these typedef statements would generate these MASM statements:

SWORD TYPEDEF SWORD

BYTE TYPEDEF BYTE

See Section 3.3, “Accessing Data with Pointers and Addresses,” for information on using TYPEDEF in MASM 6.0.