<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[131750] trunk/dports/lang/libcxx</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/131750">131750</a></dd>
<dt>Author</dt> <dd>jeremyhu@macports.org</dd>
<dt>Date</dt> <dd>2015-01-16 22:29:27 -0800 (Fri, 16 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>libcxx: Pull in David Fang's patch to add (very slow) 64bit atomics to ppc libc++</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportslanglibcxxPortfile">trunk/dports/lang/libcxx/Portfile</a></li>
<li><a href="#trunkdportslanglibcxxfiles0001builditbuildfixforLeopardpatch">trunk/dports/lang/libcxx/files/0001-buildit-build-fix-for-Leopard.patch</a></li>
<li><a href="#trunkdportslanglibcxxfiles0002builditSetcompatibilityversiontoRC_ProjectSourcpatch">trunk/dports/lang/libcxx/files/0002-buildit-Set-compatibility-version-to-RC_ProjectSourc.patch</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportslanglibcxxfiles0003FixlocalanditeratorwhenbuildingwithLionandnpatch">trunk/dports/lang/libcxx/files/0003-Fix-local-and-iterator-when-building-with-Lion-and-n.patch</a></li>
<li><a href="#trunkdportslanglibcxxfiles0004implementatomicusingmutexlock_guardfor64bopspatch">trunk/dports/lang/libcxx/files/0004-implement-atomic-using-mutex-lock_guard-for-64b-ops-.patch</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportslanglibcxxPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/lang/libcxx/Portfile (131749 => 131750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/lang/libcxx/Portfile        2015-01-17 05:49:11 UTC (rev 131749)
+++ trunk/dports/lang/libcxx/Portfile        2015-01-17 06:29:27 UTC (rev 131750)
</span><span class="lines">@@ -5,6 +5,7 @@
</span><span class="cx"> 
</span><span class="cx"> name                    libcxx
</span><span class="cx"> version                 3.5.1
</span><ins>+revision                1
</ins><span class="cx"> epoch                   1
</span><span class="cx"> categories              lang
</span><span class="cx"> platforms               darwin
</span><span class="lines">@@ -68,7 +69,9 @@
</span><span class="cx">     patch.pre_args -p1
</span><span class="cx">     patchfiles-append \
</span><span class="cx">         0001-buildit-build-fix-for-Leopard.patch \
</span><del>-        0002-buildit-Set-compatibility-version-to-RC_ProjectSourc.patch
</del><ins>+        0002-buildit-Set-compatibility-version-to-RC_ProjectSourc.patch \
+        0003-Fix-local-and-iterator-when-building-with-Lion-and-n.patch \
+        0004-implement-atomic-using-mutex-lock_guard-for-64b-ops-.patch
</ins><span class="cx"> 
</span><span class="cx">     build.dir ${worksrcpath}/lib
</span><span class="cx">     build.cmd ./buildit
</span></span></pre></div>
<a id="trunkdportslanglibcxxfiles0001builditbuildfixforLeopardpatch"></a>
<div class="modfile"><h4>Modified: trunk/dports/lang/libcxx/files/0001-buildit-build-fix-for-Leopard.patch (131749 => 131750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/lang/libcxx/files/0001-buildit-build-fix-for-Leopard.patch        2015-01-17 05:49:11 UTC (rev 131749)
+++ trunk/dports/lang/libcxx/files/0001-buildit-build-fix-for-Leopard.patch        2015-01-17 06:29:27 UTC (rev 131750)
</span><span class="lines">@@ -1,9 +1,10 @@
</span><del>-From 357f51a5693be595909be627d11bfba20e3944cd Mon Sep 17 00:00:00 2001
</del><ins>+From bb8bfbe6e5de7d6cebe38a3af0b9a492336714a7 Mon Sep 17 00:00:00 2001
</ins><span class="cx"> From: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;
</span><span class="cx"> Date: Fri, 16 Jan 2015 21:10:35 -0800
</span><del>-Subject: [PATCH 1/2] buildit build fix for Leopard
</del><ins>+Subject: [PATCH 1/4] buildit build fix for Leopard
</ins><span class="cx"> 
</span><span class="cx"> Signed-off-by: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;
</span><ins>+(cherry picked from commit 357f51a5693be595909be627d11bfba20e3944cd)
</ins><span class="cx"> ---
</span><span class="cx">  lib/buildit | 4 ++--
</span><span class="cx">  1 file changed, 2 insertions(+), 2 deletions(-)
</span></span></pre></div>
<a id="trunkdportslanglibcxxfiles0002builditSetcompatibilityversiontoRC_ProjectSourcpatch"></a>
<div class="modfile"><h4>Modified: trunk/dports/lang/libcxx/files/0002-buildit-Set-compatibility-version-to-RC_ProjectSourc.patch (131749 => 131750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/lang/libcxx/files/0002-buildit-Set-compatibility-version-to-RC_ProjectSourc.patch        2015-01-17 05:49:11 UTC (rev 131749)
+++ trunk/dports/lang/libcxx/files/0002-buildit-Set-compatibility-version-to-RC_ProjectSourc.patch        2015-01-17 06:29:27 UTC (rev 131750)
</span><span class="lines">@@ -1,10 +1,11 @@
</span><del>-From f76bf5631a732baf296f331f1c6b6d6fb12b481a Mon Sep 17 00:00:00 2001
</del><ins>+From 6d6c5b2be37820441b003596800add52ad08b9bb Mon Sep 17 00:00:00 2001
</ins><span class="cx"> From: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;
</span><span class="cx"> Date: Fri, 16 Jan 2015 21:11:37 -0800
</span><del>-Subject: [PATCH 2/2] buildit: Set compatibility version to
</del><ins>+Subject: [PATCH 2/4] buildit: Set compatibility version to
</ins><span class="cx">  RC_ProjectSourceVersion
</span><span class="cx"> 
</span><span class="cx"> Signed-off-by: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;
</span><ins>+(cherry picked from commit f76bf5631a732baf296f331f1c6b6d6fb12b481a)
</ins><span class="cx"> ---
</span><span class="cx">  lib/buildit | 3 ++-
</span><span class="cx">  1 file changed, 2 insertions(+), 1 deletion(-)
</span></span></pre></div>
<a id="trunkdportslanglibcxxfiles0003FixlocalanditeratorwhenbuildingwithLionandnpatch"></a>
<div class="addfile"><h4>Added: trunk/dports/lang/libcxx/files/0003-Fix-local-and-iterator-when-building-with-Lion-and-n.patch (0 => 131750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/lang/libcxx/files/0003-Fix-local-and-iterator-when-building-with-Lion-and-n.patch                                (rev 0)
+++ trunk/dports/lang/libcxx/files/0003-Fix-local-and-iterator-when-building-with-Lion-and-n.patch        2015-01-17 06:29:27 UTC (rev 131750)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+From e34bdf68de77066864ff3238d89fd19e19b3b508 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;
+Date: Fri, 16 Jan 2015 21:34:36 -0800
+Subject: [PATCH 3/4] Fix &lt;local&gt; and &lt;iterator&gt; when building with Lion and
+ newer Availability.h
+
+Signed-off-by: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;
+(cherry picked from commit e8d7616436baea0e0ff1dd78bd8d8dfc5d367e44)
+---
+ include/iterator | 4 ++--
+ include/locale   | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/include/iterator b/include/iterator
+index f338e01..64b52e7 100644
+--- a/include/iterator
++++ b/include/iterator
+@@ -913,8 +913,8 @@ public:
+     _LIBCPP_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == 0;}

+ #if !defined(__APPLE__) || \
+-    (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt; __MAC_10_8) || \
+-    (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt; __IPHONE_6_0)
++    (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) &amp;&amp; defined(__MAC_10_8) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt; __MAC_10_8) || \
++    (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) &amp;&amp; defined(__IPHONE_6_0) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt; __IPHONE_6_0)

+     template &lt;class _Ch, class _Tr&gt;
+     friend
+diff --git a/include/locale b/include/locale
+index fcff402..10d8ca9 100644
+--- a/include/locale
++++ b/include/locale
+@@ -1467,8 +1467,8 @@ __pad_and_output(_OutputIterator __s,
+ }

+ #if !defined(__APPLE__) || \
+-    (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt; __MAC_10_8) || \
+-    (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt; __IPHONE_6_0)
++    (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) &amp;&amp; defined(__MAC_10_8) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt; __MAC_10_8) || \
++    (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) &amp;&amp; defined(__IPHONE_6_0) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt; __IPHONE_6_0)

+ template &lt;class _CharT, class _Traits&gt;
+ _LIBCPP_HIDDEN
+-- 
+2.2.2
+
</ins></span></pre></div>
<a id="trunkdportslanglibcxxfiles0004implementatomicusingmutexlock_guardfor64bopspatch"></a>
<div class="addfile"><h4>Added: trunk/dports/lang/libcxx/files/0004-implement-atomic-using-mutex-lock_guard-for-64b-ops-.patch (0 => 131750)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/lang/libcxx/files/0004-implement-atomic-using-mutex-lock_guard-for-64b-ops-.patch                                (rev 0)
+++ trunk/dports/lang/libcxx/files/0004-implement-atomic-using-mutex-lock_guard-for-64b-ops-.patch        2015-01-17 06:29:27 UTC (rev 131750)
</span><span class="lines">@@ -0,0 +1,320 @@
</span><ins>+From bab1ec954fe3ca9d6733da96c2d1bf46bd9345e7 Mon Sep 17 00:00:00 2001
+From: David Fang &lt;fang@csl.cornell.edu&gt;
+Date: Wed, 15 Jan 2014 21:27:34 -0800
+Subject: [PATCH 4/4] implement atomic&lt;&gt; using mutex/lock_guard for 64b ops on
+ 32b PPC not pretty, not fast, but passes atomic tests
+
+(cherry picked from commit 8ec078a3bf34383cf8a0cbc6294ddf0da6bc3bed)
+
+Conflicts:
+        include/atomic
+---
+ include/__atomic_locked | 240 ++++++++++++++++++++++++++++++++++++++++++++++++
+ include/atomic          |  46 ++++++++++
+ 2 files changed, 286 insertions(+)
+ create mode 100644 include/__atomic_locked
+
+diff --git a/include/__atomic_locked b/include/__atomic_locked
+new file mode 100644
+index 0000000..f10dd74
+--- /dev/null
++++ b/include/__atomic_locked
+@@ -0,0 +1,240 @@
++// -*- C++ -*-
++//===--------------------------- __atomic_locked --------------------------===//
++//
++//                     The LLVM Compiler Infrastructure
++//
++// This file is distributed under the University of Illinois Open Source
++// License. See LICENSE.TXT for details.
++//
++//===----------------------------------------------------------------------===//
++
++#ifndef _LIBCPP_ATOMIC_LOCKED
++#define _LIBCPP_ATOMIC_LOCKED
++
++#include &lt;__mutex_base&gt;        // for mutex and lock_guard
++
++/**
++        This provides slow-but-usable lock-based atomic access to
++        structures for which atomic lock-free functions are missing.
++        This is motivated by the desire for 64b atomic operations
++        on 32b PowerPC architectures.  
++**/
++
++#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
++#pragma GCC system_header
++#endif
++
++_LIBCPP_BEGIN_NAMESPACE_STD
++
++template &lt;class _Tp, bool = is_integral&lt;_Tp&gt;::value &amp;&amp; !is_same&lt;_Tp, bool&gt;::value&gt;
++struct __atomic_mutex_locked  // false
++{
++    mutable _Atomic(_Tp) __a_;
++    mutable mutex __lock_;
++    typedef lock_guard&lt;mutex&gt;        lock_type;
++
++    _Tp&amp; na(void) const { return reinterpret_cast&lt;_Tp&amp;&gt;(__a_); }
++    volatile _Tp&amp; na(void) const volatile { return reinterpret_cast&lt;volatile _Tp&amp;&gt;(__a_); }
++
++    _LIBCPP_INLINE_VISIBILITY
++    bool is_lock_free() const volatile _NOEXCEPT
++        {return false;}
++    _LIBCPP_INLINE_VISIBILITY
++    bool is_lock_free() const _NOEXCEPT
++        {return false;}
++    _LIBCPP_INLINE_VISIBILITY
++    void store(_Tp __d, memory_order = memory_order_seq_cst) volatile _NOEXCEPT
++        { const lock_type g(const_cast&lt;mutex&amp;&gt;(__lock_)); na() = __d; }
++    _LIBCPP_INLINE_VISIBILITY
++    void store(_Tp __d, memory_order = memory_order_seq_cst) _NOEXCEPT
++        { const lock_type g(__lock_); na() = __d; }
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp load(memory_order = memory_order_seq_cst) const volatile _NOEXCEPT
++        { const lock_type g(const_cast&lt;mutex&amp;&gt;(__lock_)); return na(); }
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp load(memory_order = memory_order_seq_cst) const _NOEXCEPT
++        { const lock_type g(__lock_); return na(); }
++    _LIBCPP_INLINE_VISIBILITY
++    operator _Tp() const volatile _NOEXCEPT {return load();}
++    _LIBCPP_INLINE_VISIBILITY
++    operator _Tp() const _NOEXCEPT          {return load();}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp exchange(_Tp __d, memory_order = memory_order_seq_cst) volatile _NOEXCEPT
++        { const lock_type g(const_cast&lt;mutex&amp;&gt;(__lock_));
++        // or use std::swap
++          const _Tp ret = na(); na() = __d; return ret; }
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp exchange(_Tp __d, memory_order = memory_order_seq_cst) _NOEXCEPT
++        { const lock_type g(__lock_);
++        // or use std::swap
++          const _Tp ret = na(); na() = __d; return ret; }
++    _LIBCPP_INLINE_VISIBILITY
++    bool compare_exchange_weak(_Tp&amp; __e, _Tp __d,
++                               memory_order __s, memory_order __f) volatile _NOEXCEPT
++        { const lock_type g(const_cast&lt;mutex&amp;&gt;(__lock_));
++          if (na() == __e) { na() = __d; return true; }
++          else { __e = na(); return false; }
++        }
++    _LIBCPP_INLINE_VISIBILITY
++    bool compare_exchange_weak(_Tp&amp; __e, _Tp __d,
++                               memory_order __s, memory_order __f) _NOEXCEPT
++        { const lock_type g(__lock_);
++          if (na() == __e) { na() = __d; return true; }
++          else { __e = na(); return false; }
++        }
++
++    // for now, _weak inditinguishable from _strong
++    _LIBCPP_INLINE_VISIBILITY
++    bool compare_exchange_strong(_Tp&amp; __e, _Tp __d,
++                                 memory_order __s, memory_order __f) volatile _NOEXCEPT
++        {return compare_exchange_weak(__e, __d, __s, __f);}
++    _LIBCPP_INLINE_VISIBILITY
++    bool compare_exchange_strong(_Tp&amp; __e, _Tp __d,
++                                 memory_order __s, memory_order __f) _NOEXCEPT
++        {return compare_exchange_weak(__e, __d, __s, __f);}
++    _LIBCPP_INLINE_VISIBILITY
++    bool compare_exchange_weak(_Tp&amp; __e, _Tp __d,
++                              memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
++        {return compare_exchange_weak(__e, __d, __m, __m);}
++    _LIBCPP_INLINE_VISIBILITY
++    bool compare_exchange_weak(_Tp&amp; __e, _Tp __d,
++                               memory_order __m = memory_order_seq_cst) _NOEXCEPT
++        {return compare_exchange_weak(__e, __d, __m, __m);}
++    _LIBCPP_INLINE_VISIBILITY
++    bool compare_exchange_strong(_Tp&amp; __e, _Tp __d,
++                              memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
++        {return compare_exchange_strong(__e, __d, __m, __m);}
++    _LIBCPP_INLINE_VISIBILITY
++    bool compare_exchange_strong(_Tp&amp; __e, _Tp __d,
++                                 memory_order __m = memory_order_seq_cst) _NOEXCEPT
++        {return compare_exchange_strong(__e, __d, __m, __m);}
++
++    _LIBCPP_INLINE_VISIBILITY
++#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
++    __atomic_mutex_locked() _NOEXCEPT = default;
++#else
++    __atomic_mutex_locked() _NOEXCEPT : __a_() {}
++#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
++
++    _LIBCPP_INLINE_VISIBILITY
++    _LIBCPP_CONSTEXPR __atomic_mutex_locked(_Tp __d) _NOEXCEPT : __a_(__d) {}
++#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
++    __atomic_mutex_locked(const __atomic_mutex_locked&amp;) = delete;
++    __atomic_mutex_locked&amp; operator=(const __atomic_mutex_locked&amp;) = delete;
++    __atomic_mutex_locked&amp; operator=(const __atomic_mutex_locked&amp;) volatile = delete;
++#else  // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
++private:
++    __atomic_mutex_locked(const __atomic_mutex_locked&amp;);
++    __atomic_mutex_locked&amp; operator=(const __atomic_mutex_locked&amp;);
++    __atomic_mutex_locked&amp; operator=(const __atomic_mutex_locked&amp;) volatile;
++#endif  // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
++};        // end struct __atomic_mutex_locked
++
++// atomic&lt;Integral&gt;
++
++template &lt;class _Tp&gt;
++struct __atomic_mutex_locked&lt;_Tp, true&gt;
++    : public __atomic_mutex_locked&lt;_Tp, false&gt;
++{
++    typedef __atomic_mutex_locked&lt;_Tp, false&gt; __base;
++    typedef        typename __base::lock_type        lock_type;
++    using __base::__lock_;
++    using __base::na;
++
++    _LIBCPP_INLINE_VISIBILITY
++    __atomic_mutex_locked() _NOEXCEPT _LIBCPP_DEFAULT
++    _LIBCPP_INLINE_VISIBILITY
++    _LIBCPP_CONSTEXPR __atomic_mutex_locked(_Tp __d) _NOEXCEPT : __base(__d) {}
++
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
++        { const lock_type g(const_cast&lt;mutex&amp;&gt;(__lock_));
++          const _Tp ret = na(); na() += __op; return ret;
++        }
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
++        { const lock_type g(__lock_);
++          const _Tp ret = na(); na() += __op; return ret;
++        }
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
++        { const lock_type g(const_cast&lt;mutex&amp;&gt;(__lock_));
++          const _Tp ret = na(); na() -= __op; return ret;
++        }
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
++        { const lock_type g(__lock_);
++          const _Tp ret = na(); na() -= __op; return ret;
++        }
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
++        { const lock_type g(const_cast&lt;mutex&amp;&gt;(__lock_));
++          const _Tp ret = na(); na() &amp;= __op; return ret;
++        }
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
++        { const lock_type g(__lock_);
++          const _Tp ret = na(); na() &amp;= __op; return ret;
++        }
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
++        { const lock_type g(const_cast&lt;mutex&amp;&gt;(__lock_));
++          const _Tp ret = na(); na() |= __op; return ret;
++        }
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
++        { const lock_type g(__lock_);
++          const _Tp ret = na(); na() |= __op; return ret;
++        }
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
++        { const lock_type g(const_cast&lt;mutex&amp;&gt;(__lock_));
++          const _Tp ret = na(); na() ^= __op; return ret;
++        }
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
++        { const lock_type g(__lock_);
++          const _Tp ret = na(); na() ^= __op; return ret;
++        }
++
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator++(int) volatile _NOEXCEPT      {return fetch_add(_Tp(1));}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator++(int) _NOEXCEPT               {return fetch_add(_Tp(1));}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator--(int) volatile _NOEXCEPT      {return fetch_sub(_Tp(1));}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator--(int) _NOEXCEPT               {return fetch_sub(_Tp(1));}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator++() volatile _NOEXCEPT         {return fetch_add(_Tp(1)) + _Tp(1);}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator++() _NOEXCEPT                  {return fetch_add(_Tp(1)) + _Tp(1);}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator--() volatile _NOEXCEPT         {return fetch_sub(_Tp(1)) - _Tp(1);}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator--() _NOEXCEPT                  {return fetch_sub(_Tp(1)) - _Tp(1);}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator+=(_Tp __op) volatile _NOEXCEPT {return fetch_add(__op) + __op;}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator+=(_Tp __op) _NOEXCEPT          {return fetch_add(__op) + __op;}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator-=(_Tp __op) volatile _NOEXCEPT {return fetch_sub(__op) - __op;}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator-=(_Tp __op) _NOEXCEPT          {return fetch_sub(__op) - __op;}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator&amp;=(_Tp __op) volatile _NOEXCEPT {return fetch_and(__op) &amp; __op;}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator&amp;=(_Tp __op) _NOEXCEPT          {return fetch_and(__op) &amp; __op;}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator|=(_Tp __op) volatile _NOEXCEPT {return fetch_or(__op) | __op;}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator|=(_Tp __op) _NOEXCEPT          {return fetch_or(__op) | __op;}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator^=(_Tp __op) volatile _NOEXCEPT {return fetch_xor(__op) ^ __op;}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator^=(_Tp __op) _NOEXCEPT          {return fetch_xor(__op) ^ __op;}
++};
++
++_LIBCPP_END_NAMESPACE_STD
++
++#endif  // _LIBCPP_ATOMIC_LOCKED
+diff --git a/include/atomic b/include/atomic
+index f6ab1cb..e580315 100644
+--- a/include/atomic
++++ b/include/atomic
+@@ -1528,4 +1528,50 @@ typedef atomic&lt;uintmax_t&gt; atomic_uintmax_t;

+ _LIBCPP_END_NAMESPACE_STD

++#if        defined(__ppc__) &amp;&amp; !defined(__ppc64__)
++// specialize fallback implementation where 64b atomics are missing
++#include &lt;__atomic_locked&gt;
++
++_LIBCPP_BEGIN_NAMESPACE_STD
++
++template &lt;&gt;
++struct atomic&lt;long long&gt; : public __atomic_mutex_locked&lt;long long&gt;
++{
++    typedef long long                _Tp;
++    typedef __atomic_mutex_locked&lt;_Tp&gt; __base;
++    _LIBCPP_INLINE_VISIBILITY
++    atomic() _NOEXCEPT _LIBCPP_DEFAULT
++    _LIBCPP_INLINE_VISIBILITY
++    _LIBCPP_CONSTEXPR atomic(_Tp __d) _NOEXCEPT : __base(__d) {}
++
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator=(_Tp __d) volatile _NOEXCEPT
++        {__base::store(__d); return __d;}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator=(_Tp __d) _NOEXCEPT
++        {__base::store(__d); return __d;}
++};
++
++template &lt;&gt;
++struct atomic&lt;unsigned long long&gt; :
++        public __atomic_mutex_locked&lt;unsigned long long&gt;
++{
++    typedef unsigned long long                _Tp;
++    typedef __atomic_mutex_locked&lt;_Tp&gt; __base;
++    _LIBCPP_INLINE_VISIBILITY
++    atomic() _NOEXCEPT _LIBCPP_DEFAULT
++    _LIBCPP_INLINE_VISIBILITY
++    _LIBCPP_CONSTEXPR atomic(_Tp __d) _NOEXCEPT : __base(__d) {}
++
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator=(_Tp __d) volatile _NOEXCEPT
++        {__base::store(__d); return __d;}
++    _LIBCPP_INLINE_VISIBILITY
++    _Tp operator=(_Tp __d) _NOEXCEPT
++        {__base::store(__d); return __d;}
++};
++
++_LIBCPP_END_NAMESPACE_STD
++#endif        // defined(__ppc__) &amp;&amp; !defined(__ppc64__)
++
+ #endif  // _LIBCPP_ATOMIC
+-- 
+2.2.2
+
</ins></span></pre>
</div>
</div>

</body>
</html>