Example: Effect of Forward Declarations on the Data Model
In the following figure, struct Foo does not use the
P128 data model in effect at the time of its forward-declaration.
Instead, struct Foo uses the LLP64 data model in effect
at the time struct Foo is fully declared.
Figure 1. Example
of a Forward Declaration Based on the LLP64 Data Model
#pragma datamodel(P128)
struct Foo; //forward declaration
#pragma datamodel(LLP64)
struct Foo {
char* string; // this pointer is 8-byte because LLP64 datamodel
// was in effect for the struct definition.
};
#pragma datamodel(pop)
#pragma datamodel(pop)