Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(512)

Unified Diff: nspr/pr/include/md/_linux.h

Issue 407383002: Update to NSPR 4.10.7 Beta 3. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/nss
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « README.chromium ('k') | nspr/pr/include/md/_linux.cfg » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nspr/pr/include/md/_linux.h
diff --git a/nspr/pr/include/md/_linux.h b/nspr/pr/include/md/_linux.h
index 906822fb8416ddc63911c4e4b0bff37448b7dd9c..278f90cd6c9e3c9d6a6541434f3116da09fa1538 100644
--- a/nspr/pr/include/md/_linux.h
+++ b/nspr/pr/include/md/_linux.h
@@ -80,7 +80,7 @@
#define NO_DLOPEN_NULL
#endif
-#ifdef __FreeBSD_kernel__
+#if defined(__FreeBSD_kernel__) || defined(__GNU__)
#define _PR_HAVE_SOCKADDR_LEN
#endif
@@ -136,6 +136,18 @@ extern PRInt32 _PR_ppc_AtomicSet(PRInt32 *val, PRInt32 newval);
#define _MD_ATOMIC_SET _PR_ppc_AtomicSet
#endif
+#if defined(__powerpc64__)
+#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
+/* Use GCC built-in functions */
+#define _PR_HAVE_ATOMIC_OPS
+#define _MD_INIT_ATOMIC()
+#define _MD_ATOMIC_INCREMENT(ptr) __sync_add_and_fetch(ptr, 1)
+#define _MD_ATOMIC_DECREMENT(ptr) __sync_sub_and_fetch(ptr, 1)
+#define _MD_ATOMIC_ADD(ptr, i) __sync_add_and_fetch(ptr, i)
+#define _MD_ATOMIC_SET(ptr, nv) __sync_lock_test_and_set(ptr, nv)
+#endif
+#endif
+
#if defined(__alpha)
#define _PR_HAVE_ATOMIC_OPS
#define _MD_INIT_ATOMIC()
« no previous file with comments | « README.chromium ('k') | nspr/pr/include/md/_linux.cfg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698