[libcxxabi] r217262 - s/LIBCXXABI_SINGLE_THREADED/LIBCXXABI_HAS_NO_THREADS/ for consistency with libcxx

Jonathan Roelofs jonathan at codesourcery.com
Fri Sep 5 10:46:41 PDT 2014


Author: jroelofs
Date: Fri Sep  5 12:46:40 2014
New Revision: 217262

URL: http://llvm.org/viewvc/llvm-project?rev=217262&view=rev
Log:
s/LIBCXXABI_SINGLE_THREADED/LIBCXXABI_HAS_NO_THREADS/ for consistency with libcxx

Also remove the audotedection part so that if you're crazy enough to want a
single-threaded abi library, you'll say so explicitly in the build.

Modified:
    libcxxabi/trunk/src/config.h
    libcxxabi/trunk/src/cxa_exception.cpp
    libcxxabi/trunk/src/cxa_exception_storage.cpp
    libcxxabi/trunk/src/cxa_guard.cpp
    libcxxabi/trunk/src/fallback_malloc.ipp
    libcxxabi/trunk/test/test_exception_storage.cpp

Modified: libcxxabi/trunk/src/config.h
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/config.h?rev=217262&r1=217261&r2=217262&view=diff
==============================================================================
--- libcxxabi/trunk/src/config.h (original)
+++ libcxxabi/trunk/src/config.h Fri Sep  5 12:46:40 2014
@@ -16,11 +16,9 @@
 
 #include <unistd.h>
 
-#if !defined(LIBCXXABI_SINGLE_THREADED) && \
-    defined(_POSIX_THREADS) && _POSIX_THREADS > 0
-#  define LIBCXXABI_SINGLE_THREADED 0
-#else
-#  define LIBCXXABI_SINGLE_THREADED 1
+// Set this in the CXXFLAGS when you need it
+#if !defined(LIBCXXABI_HAS_NO_THREADS)
+#  define LIBCXXABI_HAS_NO_THREADS 0
 #endif
 
 // Set this in the CXXFLAGS when you need it, because otherwise we'd have to

Modified: libcxxabi/trunk/src/cxa_exception.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_exception.cpp?rev=217262&r1=217261&r2=217262&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_exception.cpp (original)
+++ libcxxabi/trunk/src/cxa_exception.cpp Fri Sep  5 12:46:40 2014
@@ -17,7 +17,7 @@
 #include <exception>        // for std::terminate
 #include <cstdlib>          // for malloc, free
 #include <cstring>          // for memset
-#if !LIBCXXABI_SINGLE_THREADED
+#if !LIBCXXABI_HAS_NO_THREADS
 #  include <pthread.h>      // for fallback_malloc.ipp's mutexes
 #endif
 #include "cxa_exception.hpp"

Modified: libcxxabi/trunk/src/cxa_exception_storage.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_exception_storage.cpp?rev=217262&r1=217261&r2=217262&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_exception_storage.cpp (original)
+++ libcxxabi/trunk/src/cxa_exception_storage.cpp Fri Sep  5 12:46:40 2014
@@ -15,7 +15,7 @@
 
 #include "config.h"
 
-#if LIBCXXABI_SINGLE_THREADED
+#if LIBCXXABI_HAS_NO_THREADS
 
 namespace __cxxabiv1 {
 extern "C" {

Modified: libcxxabi/trunk/src/cxa_guard.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_guard.cpp?rev=217262&r1=217261&r2=217262&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_guard.cpp (original)
+++ libcxxabi/trunk/src/cxa_guard.cpp Fri Sep  5 12:46:40 2014
@@ -10,7 +10,7 @@
 #include "abort_message.h"
 #include "config.h"
 
-#if !LIBCXXABI_SINGLE_THREADED
+#if !LIBCXXABI_HAS_NO_THREADS
 #  include <pthread.h>
 #endif
 #include <stdint.h>
@@ -62,7 +62,7 @@ void set_initialized(guard_type* guard_o
 
 #endif
 
-#if !LIBCXXABI_SINGLE_THREADED
+#if !LIBCXXABI_HAS_NO_THREADS
 pthread_mutex_t guard_mut = PTHREAD_MUTEX_INITIALIZER;
 pthread_cond_t  guard_cv  = PTHREAD_COND_INITIALIZER;
 #endif
@@ -166,7 +166,7 @@ set_lock(uint32_t& x, lock_type y)
 extern "C"
 {
 
-#if LIBCXXABI_SINGLE_THREADED
+#if LIBCXXABI_HAS_NO_THREADS
 int __cxa_guard_acquire(guard_type* guard_object)
 {
     return !is_initialized(guard_object);
@@ -183,7 +183,7 @@ void __cxa_guard_abort(guard_type* guard
     *guard_object = 0;
 }
 
-#else // !LIBCXXABI_SINGLE_THREADED
+#else // !LIBCXXABI_HAS_NO_THREADS
 
 int __cxa_guard_acquire(guard_type* guard_object)
 {
@@ -250,7 +250,7 @@ void __cxa_guard_abort(guard_type* guard
         abort_message("__cxa_guard_abort failed to broadcast condition variable");
 }
 
-#endif // !LIBCXXABI_SINGLE_THREADED
+#endif // !LIBCXXABI_HAS_NO_THREADS
 
 }  // extern "C"
 

Modified: libcxxabi/trunk/src/fallback_malloc.ipp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/fallback_malloc.ipp?rev=217262&r1=217261&r2=217262&view=diff
==============================================================================
--- libcxxabi/trunk/src/fallback_malloc.ipp (original)
+++ libcxxabi/trunk/src/fallback_malloc.ipp Fri Sep  5 12:46:40 2014
@@ -26,7 +26,7 @@
 namespace {
 
 // When POSIX threads are not available, make the mutex operations a nop
-#if LIBCXXABI_SINGLE_THREADED
+#if LIBCXXABI_HAS_NO_THREADS
 static void * heap_mutex = 0;
 #else
 static pthread_mutex_t heap_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -34,7 +34,7 @@ static pthread_mutex_t heap_mutex = PTHR
 
 class mutexor {
 public:
-#if LIBCXXABI_SINGLE_THREADED
+#if LIBCXXABI_HAS_NO_THREADS
     mutexor ( void * ) {}
     ~mutexor () {}
 #else
@@ -44,7 +44,7 @@ public:
 private:
     mutexor ( const mutexor &rhs );
     mutexor & operator = ( const mutexor &rhs );
-#if !LIBCXXABI_SINGLE_THREADED
+#if !LIBCXXABI_HAS_NO_THREADS
     pthread_mutex_t *mtx_;
 #endif
     };

Modified: libcxxabi/trunk/test/test_exception_storage.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/test_exception_storage.cpp?rev=217262&r1=217261&r2=217262&view=diff
==============================================================================
--- libcxxabi/trunk/test/test_exception_storage.cpp (original)
+++ libcxxabi/trunk/test/test_exception_storage.cpp Fri Sep  5 12:46:40 2014
@@ -12,7 +12,7 @@
 #include <cstdlib>
 #include <algorithm>
 #include <iostream>
-#if !LIBCXXABI_SINGLE_THREADED
+#if !LIBCXXABI_HAS_NO_THREADS
 #  include <pthread.h>
 #endif
 #include <unistd.h>
@@ -38,7 +38,7 @@ void *thread_code (void *parm) {
     return parm;
     }
 
-#if !LIBCXXABI_SINGLE_THREADED
+#if !LIBCXXABI_HAS_NO_THREADS
 #define NUMTHREADS  10
 size_t      thread_globals [ NUMTHREADS ] = { 0 };
 pthread_t   threads        [ NUMTHREADS ];
@@ -54,7 +54,7 @@ void print_sizes ( size_t *first, size_t
 int main ( int argc, char *argv [] ) {
     int retVal = 0;
 
-#if LIBCXXABI_SINGLE_THREADED
+#if LIBCXXABI_HAS_NO_THREADS
     size_t thread_globals;
     retVal = thread_code(&thread_globals) != 0;
 #else





More information about the cfe-commits mailing list