diff options
author | Johannes Weißl <[email protected]> | 2013-06-18 10:14:34 +0200 |
---|---|---|
committer | Johannes Weißl <[email protected]> | 2013-07-18 09:41:20 +0200 |
commit | 15eba817c5da7fd91dba9b176bffe908b889e3b9 (patch) | |
tree | cdbf9374748e9c39691300449be69701e458a5dd /erts/include/internal/gcc | |
parent | c6f452c340ad1749ce91c037a4820ea0feb0a644 (diff) | |
download | otp-15eba817c5da7fd91dba9b176bffe908b889e3b9.tar.gz otp-15eba817c5da7fd91dba9b176bffe908b889e3b9.tar.bz2 otp-15eba817c5da7fd91dba9b176bffe908b889e3b9.zip |
Fix compile error on ARM and GCC < 4.1.0
Since b29ecbd (OTP-10418, R15B03) Erlang does not compile anymore with
old versions of GCC that do not have atomic ops builtins on platforms
where there is no native ethread implementation (e.g. ARM):
In file included from ../include/internal/gcc/ethread.h:29,
from ../include/internal/ethread.h:354,
from beam/erl_threads.h:264,
from beam/erl_smp.h:27,
from beam/sys.h:413,
from hipe/hipe_mkliterals.c:29:
../include/internal/gcc/ethr_membar.h:49:4: error: #error "No __sync_val_compare_and_swap"
This patch adds a header guard in "gcc/ethread.h", as is present in
"libatomic_ops/ethread.h".
Diffstat (limited to 'erts/include/internal/gcc')
-rw-r--r-- | erts/include/internal/gcc/ethread.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/erts/include/internal/gcc/ethread.h b/erts/include/internal/gcc/ethread.h index fcfdc39441..365a3535cf 100644 --- a/erts/include/internal/gcc/ethread.h +++ b/erts/include/internal/gcc/ethread.h @@ -25,6 +25,9 @@ #ifndef ETHREAD_GCC_H__ #define ETHREAD_GCC_H__ +#if defined(ETHR_HAVE___SYNC_VAL_COMPARE_AND_SWAP32) \ + || defined(ETHR_HAVE___SYNC_VAL_COMPARE_AND_SWAP64) + #ifndef ETHR_MEMBAR # include "ethr_membar.h" #endif @@ -46,3 +49,5 @@ #endif #endif + +#endif |