开发者

_GLIBCXX_ATOMIC_BUILTINS not defined in gcc 4.4.5

开发者 https://www.devze.com 2023-02-22 03:17 出处:网络
I have some code that I\'m porting and I\'ve tracked d开发者_如何学编程own the error to missing

I have some code that I'm porting and I've tracked d开发者_如何学编程own the error to missing the macro _GLIBCXX_ATOMIC_BUILTINS

Do later versions of gcc not define this?

What's the proper way to get around this?


In that version you will also want to check the atomic macros for some particular data type, so you could do:

#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)

The macros are:

/* 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
0

精彩评论

暂无评论...
验证码 换一张
取 消