__declspec(align)用于多个声明 [英] __declspec(align) for multiple declarations

查看:177
本文介绍了__declspec(align)用于多个声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉,这个非常简单的问题,找不到可谷歌搜索的答案.

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

这是声明语法吗?

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

等效于此:

__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.

推荐答案

是. __declspec是存储类的一部分,适用于声明中的所有声明符.

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

这篇关于__declspec(align)用于多个声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆