我有一些正在移植的代码,并且我已经找到了丢失的错误
宏 _GLIBCXX_ATOMIC_BUILTINS
后来的gcc版本没有定义这个吗?
解决这个问题的正确方法是什么?
在该版本中,您还需要检查某些特定数据类型的原子宏,因此您可以执行以下操作:
#if defined(_GLIBCXX_ATOMIC_BUILTINS_4) && !defined(_GLIBCXX_ATOMIC_BUILTINS)
#define _GLIBCXX_ATOMIC_BUILTINS
#endif
or
#if defined(_GLIBCXX_ATOMIC_BUILTINS) || defined(_GLIBCXX_ATOMIC_BUILTINS_4)
宏是:
/* Define if builtin atomic operations for bool are supported on this host. */
#undef _GLIBCXX_ATOMIC_BUILTINS_1
/* Define if builtin atomic operations for short are supported on this host. */
#undef _GLIBCXX_ATOMIC_BUILTINS_2
/* Define if builtin atomic operations for int are supported on this host. */
#undef _GLIBCXX_ATOMIC_BUILTINS_4
/* Define if builtin atomic operations for long long are supported on this
host. */
#undef _GLIBCXX_ATOMIC_BUILTINS_8
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)