Rotem
Rotem

Reputation: 21947

__declspec(align) for multiple declarations

Sorry for the very simple question, couldn't find a googleable answer.

Is this declaration syntax:

__declspec(align(16)) float rF[4];
__declspec(align(16)) float gF[4];
__declspec(align(16)) float bF[4];

Equivalent to this:

__declspec(align(16)) float rF[4], gF[4], bF[4];

Or will only the first variable be aligned in the latter syntax?

If it matters, these are local variables inside a global method.

Upvotes: 3

Views: 1138

Answers (1)

James McNellis
James McNellis

Reputation: 355197

Yes. A __declspec is part of the storage class and applies to all declarators in the declaration.

Upvotes: 5

Related Questions