mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
libast: Fix detection of GCC 4.1+ 64/32-bit atomic operations model
This fix to the atomic scalar operations feature tests is from OpenSUSE: https://build.opensuse.org/package/view_file/shells/ksh/ksh93-aso.dif
This commit is contained in:
parent
69e18de58f
commit
e2c2753ee8
1 changed files with 7 additions and 2 deletions
|
@ -5,7 +5,10 @@ if aso note{ gcc 4.1+ 64 bit memory atomic operations model }end link{
|
|||
int main()
|
||||
{
|
||||
uint64_t i = 0;
|
||||
return __sync_fetch_and_add(&i,7);
|
||||
uint32_t j = 0;
|
||||
uint16_t l = 0;
|
||||
uint8_t m = 0;
|
||||
return __sync_fetch_and_add(&i,7)+__sync_fetch_and_add(&j,7)+__sync_fetch_and_add(&l,7)+__sync_fetch_and_add(&m,7);
|
||||
}
|
||||
}end && {
|
||||
#define _aso_cas8(p,o,n) __sync_val_compare_and_swap(p,o,n)
|
||||
|
@ -31,7 +34,9 @@ elif aso note{ gcc 4.1+ 32 bit memory atomic operations model }end link{
|
|||
int main()
|
||||
{
|
||||
uint32_t i = 0;
|
||||
return __sync_fetch_and_add(&i,7);
|
||||
uint16_t j = 0;
|
||||
uint8_t l = 0;
|
||||
return __sync_fetch_and_add(&i,7)+__sync_fetch_and_add(&j,7)+__sync_fetch_and_add(&l,7);
|
||||
}
|
||||
}end && {
|
||||
#define _aso_cas8(p,o,n) __sync_val_compare_and_swap(p,o,n)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue