ObjFW  Diff

Differences From Artifact [0e0a7c1a99]:

To Artifact [874337cdfb]:


635
636
637
638
639
640
641
642
643


644
645
646
647
648
649
650
651
635
636
637
638
639
640
641


642
643

644
645
646
647
648
649
650







-
-
+
+
-







#elif defined(OF_X86_ASM) || defined(OF_AMD64_ASM)
	int32_t r;

	__asm__ (
	    "xorl	%0, %0\n\t"
	    "lock\n\t"
	    "cmpxchg	%2, %3\n\t"
	    "jne	0\n\t"
	    "incl	%0\n"
	    "sete	%b0\n\t"
	    "movzbl	%b0, %0"
	    "0:"
	    : "=&r"(r)
	    : "a"(o), "r"(n), "m"(*p)
	);

	return r;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_bool_compare_and_swap(p, o, n);
667
668
669
670
671
672
673
674
675


676
677
678
679
680
681
682
683
666
667
668
669
670
671
672


673
674

675
676
677
678
679
680
681







-
-
+
+
-







#elif defined(OF_X86_ASM) || defined(OF_AMD64_ASM)
	int r;

	__asm__ (
	    "xorl	%0, %0\n\t"
	    "lock\n\t"
	    "cmpxchg	%2, %3\n\t"
	    "jne	0\n\t"
	    "incl	%0\n"
	    "sete	%b0\n\t"
	    "movzbl	%b0, %0"
	    "0:"
	    : "=&r"(r)
	    : "a"(o), "r"(n), "m"(*p)
	);

	return r;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_bool_compare_and_swap(p, o, n);
699
700
701
702
703
704
705
706
707


708
709
710
711
712
713
714
715
716
717
718
719
697
698
699
700
701
702
703


704
705

706
707
708
709
710
711
712
713
714
715
716







-
-
+
+
-











#elif defined(OF_X86_ASM) || defined(OF_AMD64_ASM)
	int r;

	__asm__ (
	    "xorl	%0, %0\n\t"
	    "lock\n\t"
	    "cmpxchg	%2, %3\n\t"
	    "jne	0\n\t"
	    "incl	%0\n"
	    "sete	%b0\n\t"
	    "movzbl	%b0, %0"
	    "0:"
	    : "=&r"(r)
	    : "a"(o), "r"(n), "m"(*p)
	);

	return r;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_bool_compare_and_swap(p, o, n);
#elif defined(OF_HAVE_OSATOMIC)
	return OSAtomicCompareAndSwapPtrBarrier(o, n, p);
#endif
}