For x86, it looks "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8" only apply to i586 or above. So we can't define the 4 macros for all targets.
I don't know if it is safe to define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_{1,2,4} for all targets.
And I can't find a way to compute the macros for each target either
For x86, it looks "__GCC_ HAVE_SYNC_ COMPARE_ AND_SWAP_ 8" only apply to i586 or above. So we can't define the 4 macros for all targets. SYNC_COMPARE_ AND_SWAP_ {1,2,4} for all targets.
I don't know if it is safe to define __GCC_HAVE_
And I can't find a way to compute the macros for each target either