]> granicus.if.org Git - gc/commitdiff
Fix GC_init static assertion for clang/x64 (Darwin)
authorIvan Maidanski <ivmai@mail.ru>
Sun, 4 Mar 2012 10:43:47 +0000 (14:43 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 4 Mar 2012 10:43:47 +0000 (14:43 +0400)
* misc.c (GC_init): Add a workaround for clang/x64 (coming with
Xcode 4.3) which cannot process the static assertion on
((ptr_t)-1 > 0) correctly.

misc.c

diff --git a/misc.c b/misc.c
index 2fd41664db013e89c43143e823703a22eec4d179..8db6085124bdf2b72c887a0005c0d290f76f77a7 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -930,7 +930,8 @@ GC_API void GC_CALL GC_init(void)
       GC_STATIC_ASSERT((word)(-1) > (word)0);
       /* word should be unsigned */
 #   endif
-#   if !defined(__BORLANDC__) && !defined(__CC_ARM) /* Workaround */
+#   if !defined(__BORLANDC__) && !defined(__CC_ARM) \
+       && !(defined(__clang__) && defined(X86_64)) /* Workaround */
       GC_STATIC_ASSERT((ptr_t)(word)(-1) > (ptr_t)0);
       /* Ptr_t comparisons should behave as unsigned comparisons.       */
 #   endif