当我使用 C++ 编写宏时,它会给出如下错误"the declaration has no storage type"



当我编写一个C++的宏时,它正在处理"声明没有存储类型"的错误,这是我的代码,它有什么问题?如果我使用函数实现,它运行良好。它怀疑我。

#define FLAG_CLEAR_MUL_BIT(op,beg,end) do{
long _dwFlag = 0;
for (int _i = 0; _i < end - beg;++_i)
{
_dwFlag |= (1 << _i);
}
_dwFlag = _dwFlag << beg;
_dwFlag = ~_dwFlag;    
op = op & _dwFlag; // preprocessing wrong:This declaration has no storage type,if impletment with inline function,it works well
}

可能是vs2017编辑器错误,我注释代码并在另一个地方再次编写,它编译了!! 太神奇了。

相关内容

最新更新