Change size of reference count field in __libcpp_nmstr from 32 bits to 64 bits for 64 bit targets.  This is controls the data layout of all exceptions defined in <stdexcept>.  This aligns the ABI with that of gcc-4.2.

git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@161496 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/src/stdexcept.cpp b/src/stdexcept.cpp
index 4aa962d..5ea92fb 100644
--- a/src/stdexcept.cpp
+++ b/src/stdexcept.cpp
@@ -27,7 +27,7 @@
     const char* str_;
 
     typedef std::size_t unused_t;
-    typedef std::int32_t count_t;
+    typedef std::ptrdiff_t count_t;
 
     static const std::ptrdiff_t offset = static_cast<std::ptrdiff_t>(2*sizeof(unused_t) +
                                                                        sizeof(count_t));
@@ -65,7 +65,7 @@
     const char* p = str_;
     str_ = s.str_;
     __sync_add_and_fetch(&count(), 1);
-    if (__sync_add_and_fetch((count_t*)(p-sizeof(count_t)), -1) < 0)
+    if (__sync_add_and_fetch((count_t*)(p-sizeof(count_t)), count_t(-1)) < 0)
         delete [] (p-offset);
     return *this;
 }
@@ -73,7 +73,7 @@
 inline
 __libcpp_nmstr::~__libcpp_nmstr()
 {
-    if (__sync_add_and_fetch(&count(), -1) < 0)
+    if (__sync_add_and_fetch(&count(), count_t(-1)) < 0)
         delete [] (str_ - offset);
 }