Fix build on hppa, don't assume we have gcc atomics depending on a given

GNUC version. Fallback to mutex code on hppa.
This commit is contained in:
landry 2012-07-04 09:03:16 +00:00
parent f7ea023751
commit 354048edd9

View File

@ -1,6 +1,10 @@
$OpenBSD: patch-source_common_putilimp_h,v 1.1 2012/06/22 07:07:14 ajacoutot Exp $
--- source/common/putilimp.h.orig Fri Jun 1 16:52:52 2012
+++ source/common/putilimp.h Thu Jun 21 09:27:40 2012
$OpenBSD: patch-source_common_putilimp_h,v 1.2 2012/07/04 09:03:16 landry Exp $
hppa doesnt have atomic builtins:
__sync_val_compare_and_swap, __sync_add_and_fetch, __sync_sub_and_fetch
don't assume having GNUC >= 401 implies they're here..
--- source/common/putilimp.h.orig Fri Jun 1 08:52:52 2012
+++ source/common/putilimp.h Wed Jul 4 01:00:05 2012
@@ -119,6 +119,8 @@ typedef size_t uintptr_t;
# define U_TIMEZONE _timezone
#elif U_PLATFORM == U_PF_OS400
@ -10,3 +14,12 @@ $OpenBSD: patch-source_common_putilimp_h,v 1.1 2012/06/22 07:07:14 ajacoutot Exp
#else
# define U_TIMEZONE timezone
#endif
@@ -176,7 +178,7 @@ typedef size_t uintptr_t;
*/
#ifdef U_HAVE_GCC_ATOMICS
/* Use the predefined value. */
-#elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 401)
+#elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 401) && !defined(__hppa__)
# define U_HAVE_GCC_ATOMICS 1
#else
# define U_HAVE_GCC_ATOMICS 0