diff --git a/include/internal.h b/include/internal.h index c4a90a6c..470bbfb8 100644 --- a/include/internal.h +++ b/include/internal.h @@ -93,6 +93,15 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifdef HAVE_IA64INTRIN_H # define HAVE_CMPXCHG # include + /* + * ecc v7.0 is broken: it's missing __sync_val_compare_and_swap() + * even though the ia64 ABI requires it. Work around it: + */ +# ifndef __sync_val_compare_and_swap +# define __sync_val_compare_and_swap(x,y,z) \ + _InterlockedCompareExchange64_rel(x,y,z) +# endif + # define cmpxchg_ptr(_ptr,_o,_n) \ ((void *) __sync_val_compare_and_swap((long *) (_ptr), \ (long) (_o), (long) (_n)))