_GLIBCXX_ATOMIC_BUILTINS not defined in gcc 4.4.5

后端 未结 1 1152
甜味超标
甜味超标 2021-01-28 12:57

I have some code that I\'m porting and I\'ve tracked down the error to missing the macro _GLIBCXX_ATOMIC_BUILTINS

Do later versions of gcc not define this?

What\

1条回答
  •  孤城傲影
    2021-01-28 13:25

    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 讨论(0)
提交回复
热议问题