Subject: build correctly on architectures that wound up w/NCBI_SLOW_ATOMIC_SWAP

* include/corelib/impl/ncbi_atomic_defs.h, include/corelib/ncbiatomic.h:
  fix powerpc detection, which previously only worked under Darwin.
* src/objects/seq/seq_id_*.hpp: move sx_GetSeqIdMutex to join its users.

Author: Aaron M. Ucko <ucko@debian.org>
Last-Update: 2011-06-08
Index: b/c++/include/corelib/impl/ncbi_atomic_defs.h
===================================================================
--- a/c++/include/corelib/impl/ncbi_atomic_defs.h	2011-06-08 20:26:07.000000000 -0400
+++ b/c++/include/corelib/impl/ncbi_atomic_defs.h	2011-06-08 20:29:25.000000000 -0400
@@ -259,7 +259,7 @@
 #  endif
 #endif
 
-#if !defined(NCBI_SWAP_POINTERS)  &&  !defined(NCBI_SWAP_POINTERS_CONDITIONALLY)  &&  !defined(NCBI_NO_THREADS)  &&  (!defined(NCBI_COUNTER_ASM_OK)  ||  (!defined(__i386) && !defined(__ppc__) && !defined(__ppc64__) && !defined(__sparc) && !defined(__x86_64)))
+#if !defined(NCBI_SWAP_POINTERS)  &&  !defined(NCBI_SWAP_POINTERS_CONDITIONALLY)  &&  !defined(NCBI_NO_THREADS)  &&  (!defined(NCBI_COUNTER_ASM_OK)  ||  (!defined(__i386) && !defined(__powerpc__) && !defined(__powerpc64__) && !defined(__ppc__) && !defined(__ppc64__) && !defined(__sparc) && !defined(__x86_64)))
 #  define NCBI_SWAP_POINTERS_EXTERN 1
 #  define NCBI_SLOW_ATOMIC_SWAP 1
 #endif
Index: b/c++/include/corelib/ncbiatomic.h
===================================================================
--- a/c++/include/corelib/ncbiatomic.h	2011-06-08 20:26:00.000000000 -0400
+++ b/c++/include/corelib/ncbiatomic.h	2011-06-08 20:30:34.000000000 -0400
@@ -121,14 +121,14 @@
     asm volatile("swap [%2], %1" : "=m" (*nv_loc), "=r" (old_value)
                  : "r" (nv_loc), "1" (new_value), "m" (*nv_loc));
     return old_value;
-#    elif defined(__ppc__) ||  defined(__ppc64__)
+#    elif defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__) ||  defined(__ppc64__)
     void* old_value;
     int   swapped = 0;
     NCBI_SCHED_SPIN_INIT();
     while ( !swapped ) {
         swapped = 0;
         asm volatile(
-#ifdef __ppc64__
+#if defined(__powerpc64__)  ||  defined(__ppc64__)
                      "ldarx %1,0,%4\n\tstdcx. %3,0,%4"
 #else
                      "lwarx %1,0,%4\n\tstwcx. %3,0,%4"
Index: b/c++/src/objects/seq/seq_id_handle.cpp
===================================================================
--- a/c++/src/objects/seq/seq_id_handle.cpp	2011-06-08 20:26:34.000000000 -0400
+++ b/c++/src/objects/seq/seq_id_handle.cpp	2011-06-08 20:28:43.000000000 -0400
@@ -47,11 +47,6 @@
 // CSeq_id_Info
 //
 
-//#define NCBI_SLOW_ATOMIC_SWAP
-#ifdef NCBI_SLOW_ATOMIC_SWAP
-DEFINE_STATIC_FAST_MUTEX(sx_GetSeqIdMutex);
-#endif
-
 
 CSeq_id_Info::CSeq_id_Info(CSeq_id::E_Choice type,
                            CSeq_id_Mapper* mapper)
Index: b/c++/src/objects/seq/seq_id_tree.cpp
===================================================================
--- a/c++/src/objects/seq/seq_id_tree.cpp	2011-06-08 20:26:34.000000000 -0400
+++ b/c++/src/objects/seq/seq_id_tree.cpp	2011-06-08 20:28:53.000000000 -0400
@@ -42,6 +42,11 @@
 BEGIN_NCBI_SCOPE
 BEGIN_SCOPE(objects)
 
+//#define NCBI_SLOW_ATOMIC_SWAP
+#ifdef NCBI_SLOW_ATOMIC_SWAP
+DEFINE_STATIC_FAST_MUTEX(sx_GetSeqIdMutex);
+#endif
+
 ////////////////////////////////////////////////////////////////////
 //
 //  CSeq_id_***_Tree::
