gcc 4.6 does not have __sync_add_and_fetch if it optimizes for i386,

which is the case on OpenBSD, so use the original locking code instead
this fixes the i386 build
This commit is contained in:
robert 2012-04-08 07:52:01 +00:00
parent 54ff746128
commit 729f3be346

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-sal_osl_unx_interlck_c,v 1.1 2012/04/08 07:52:01 robert Exp $
--- sal/osl/unx/interlck.c.orig.port Fri Apr 6 11:30:06 2012
+++ sal/osl/unx/interlck.c Fri Apr 6 11:30:29 2012
@@ -60,7 +60,7 @@ oslInterlockedCount SAL_CALL osl_incrementInterlockedC
: "memory");
return ++nCount;
}
-#if ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 ))
+#if ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 )) && !defined(X86)
else
return __sync_add_and_fetch (pCount, 1);
#else
@@ -89,7 +89,7 @@ oslInterlockedCount SAL_CALL osl_decrementInterlockedC
: "memory");
return --nCount;
}
-#if ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 ))
+#if ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 )) && !defined(X86)
else
return __sync_sub_and_fetch (pCount, 1);
#else