[cfe-commits] [libcxxabi] r152735 - in /libcxxabi/trunk: include/cxxabi.h src/cxa_guard.cpp

Howard Hinnant hhinnant at apple.com
Wed Mar 14 12:30:00 PDT 2012


Author: hhinnant
Date: Wed Mar 14 14:30:00 2012
New Revision: 152735

URL: http://llvm.org/viewvc/llvm-project?rev=152735&view=rev
Log:
Enable __arm__ on apple

Modified:
    libcxxabi/trunk/include/cxxabi.h
    libcxxabi/trunk/src/cxa_guard.cpp

Modified: libcxxabi/trunk/include/cxxabi.h
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/include/cxxabi.h?rev=152735&r1=152734&r2=152735&view=diff
==============================================================================
--- libcxxabi/trunk/include/cxxabi.h (original)
+++ libcxxabi/trunk/include/cxxabi.h Wed Mar 14 14:30:00 2012
@@ -64,7 +64,7 @@
 extern LIBCXXABI_NORETURN void __cxa_deleted_virtual(void);
 
 // 3.3.2 One-time Construction API
-#ifdef LIBCXXABI_ARMEABI
+#if __arm__
 extern int  __cxa_guard_acquire(uint32_t*);
 extern void __cxa_guard_release(uint32_t*);
 extern void __cxa_guard_abort(uint32_t*);

Modified: libcxxabi/trunk/src/cxa_guard.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_guard.cpp?rev=152735&r1=152734&r2=152735&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_guard.cpp (original)
+++ libcxxabi/trunk/src/cxa_guard.cpp Wed Mar 14 14:30:00 2012
@@ -28,7 +28,7 @@
 namespace
 {
 
-#if LIBCXXABI_ARMEABI
+#if __arm__
 
 // A 32-bit, 4-byte-aligned static data value. The least significant 2 bits must
 // be statically initialized to 0.
@@ -62,7 +62,7 @@
 pthread_mutex_t guard_mut = PTHREAD_MUTEX_INITIALIZER;
 pthread_cond_t  guard_cv  = PTHREAD_COND_INITIALIZER;
 
-#if __APPLE__
+#if defined(__APPLE__) && !defined(__arm_)
 
 typedef uint32_t lock_type;
 
@@ -100,7 +100,7 @@
 
 #endif  // __LITTLE_ENDIAN__
 
-#else  // __APPLE__
+#else  // !__APPLE__ || __arm__
 
 typedef bool lock_type;
 
@@ -169,7 +169,7 @@
     int result = *initialized == 0;
     if (result)
     {
-#if __APPLE__
+#if defined(__APPLE__) && !defined(__arm_)
         const lock_type id = pthread_mach_thread_np(pthread_self());
         lock_type lock = get_lock(*guard_object);
         if (lock)
@@ -189,14 +189,14 @@
         }
         else
             set_lock(*guard_object, id);
-#else  // __APPLE__
+#else  // !__APPLE__ || __arm__
         while (get_lock(*guard_object))
             if (pthread_cond_wait(&guard_cv, &guard_mut))
                 abort_message("__cxa_guard_acquire condition variable wait failed");
         result = *initialized == 0;
         if (result)
             set_lock(*guard_object, true);
-#endif  // __APPLE__
+#endif  // !__APPLE__ || __arm__
     }
     if (pthread_mutex_unlock(&guard_mut))
         abort_message("__cxa_guard_acquire failed to release mutex");





More information about the cfe-commits mailing list