错误 C1189 #error:C++ 标准库禁止宏化关键字“inline”

use*_*061 2 c++ migration inline visual-studio-2010 visual-studio-2019

我正在将一个项目从 VS 2010 迁移到 VS2019。我的代码在 VS 2010 中运行良好,而在 VS2019 中对于相同的代码却出现错误。

#undef inline
#define inline __forceinline

..///
..///code 

#undef inline
#define inline inline
Run Code Online (Sandbox Code Playgroud)

Error C1189 #error: The C++ Standard Library forbids macroizing the keyword "inline". Enable warning C4005 to find the forbidden define

我怎样才能消除这个错误。

Sor*_*ell 6

我通过将_XKEYCHECK_H添加到Properties > C/C++ > Preprocessor > Preprocessor Definitions.
参考这里

在此输入图像描述