Fix issue where the static inline part of the declaration would be improperly
authorbrbarret
Tue Feb 05 18:15:32 2013 +0000 (3 months ago)
changeset 21373b255479ad026
parent 21371 8613a1221ba0
child 21374 85978e2b8eb7
Fix issue where the static inline part of the declaration would be improperly
set when using C++
opal/include/opal/sys/atomic.h
     1.1 --- a/opal/include/opal/sys/atomic.h	Mon Feb 04 23:26:42 2013 +0000
     1.2 +++ b/opal/include/opal/sys/atomic.h	Tue Feb 05 18:15:32 2013 +0000
     1.3 @@ -316,7 +316,7 @@
     1.4  #if OPAL_HAVE_ATOMIC_SPINLOCKS == 0
     1.5  #undef OPAL_HAVE_ATOMIC_SPINLOCKS
     1.6  #define OPAL_HAVE_ATOMIC_SPINLOCKS (OPAL_HAVE_ATOMIC_CMPSET_32 || OPAL_HAVE_ATOMIC_CMPSET_64)
     1.7 -#define OPAL_NEED_INLINE_ATOMIC_SPINLOCKS
     1.8 +#define OPAL_NEED_INLINE_ATOMIC_SPINLOCKS 1
     1.9  #endif
    1.10  
    1.11  #endif /* OPAL_HAVE_ATOMIC_SPINLOCKS */
    1.12 @@ -382,24 +382,20 @@
    1.13    #define OPAL_HAVE_ATOMIC_MATH_32 0
    1.14  #endif
    1.15  
    1.16 -#if defined(DOXYGEN) ||  OPAL_HAVE_ATOMIC_MATH_32 || OPAL_HAVE_ATOMIC_CMPSET_32
    1.17 +#if defined(DOXYGEN) || OPAL_HAVE_ATOMIC_MATH_32 || OPAL_HAVE_ATOMIC_CMPSET_32
    1.18  
    1.19  /* OPAL_HAVE_INLINE_ATOMIC_*_32 will be 1 if <arch>/atomic.h provides
    1.20 -   a static inline version of it (in assembly).  If it's 0 but
    1.21 -   OPAL_HAVE_ATOMIC_CMPSET_32 is 1, then atomic_impl.h (below) will
    1.22 -   define a static inline version of it (in C, using
    1.23 -   atomic_cmpset_32()).  */
    1.24 -#if OPAL_HAVE_INLINE_ATOMIC_ADD_32 || OPAL_HAVE_ATOMIC_CMPSET_32
    1.25 +   a static inline version of it (in assembly).  If we have to fall
    1.26 +   back on cmpset 32, that too will be inline. */
    1.27 +#if OPAL_HAVE_INLINE_ATOMIC_ADD_32 || (!defined(OPAL_HAVE_ATOMIC_ADD_32) && OPAL_HAVE_ATOMIC_CMPSET_32)
    1.28  static inline
    1.29  #endif
    1.30  int32_t opal_atomic_add_32(volatile int32_t *addr, int delta);
    1.31  
    1.32  /* OPAL_HAVE_INLINE_ATOMIC_*_32 will be 1 if <arch>/atomic.h provides
    1.33 -   a static inline version of it (in assembly).  If it's 0 but
    1.34 -   OPAL_HAVE_ATOMIC_CMPSET_32 is 1, then atomic_impl.h (below) will
    1.35 -   define a static inline version of it (in C, using
    1.36 -   atomic_cmpset_32()).  */
    1.37 -#if OPAL_HAVE_INLINE_ATOMIC_SUB_32 || OPAL_HAVE_ATOMIC_CMPSET_32
    1.38 +   a static inline version of it (in assembly).  If we have to fall
    1.39 +   back to cmpset 32, that too will be inline. */
    1.40 +#if OPAL_HAVE_INLINE_ATOMIC_SUB_32 || (!defined(OPAL_HAVE_ATOMIC_ADD_32) && OPAL_HAVE_ATOMIC_CMPSET_32)
    1.41  static inline
    1.42  #endif
    1.43  int32_t opal_atomic_sub_32(volatile int32_t *addr, int delta);
    1.44 @@ -420,21 +416,17 @@
    1.45  #if defined(DOXYGEN) || OPAL_HAVE_ATOMIC_MATH_64 || OPAL_HAVE_ATOMIC_CMPSET_64
    1.46  
    1.47  /* OPAL_HAVE_INLINE_ATOMIC_*_64 will be 1 if <arch>/atomic.h provides
    1.48 -   a static inline version of it (in assembly).  If it's 0 but
    1.49 -   OPAL_HAVE_ATOMIC_CMPSET_64 is 1, then atomic_impl.h (below) will
    1.50 -   define a static inline version of it (in C, using
    1.51 -   atomic_cmpset_64()).  */
    1.52 -#if OPAL_HAVE_INLINE_ATOMIC_ADD_64 || OPAL_HAVE_ATOMIC_CMPSET_64
    1.53 +   a static inline version of it (in assembly).  If we have to fall
    1.54 +   back to cmpset 64, that too will be inline */
    1.55 +#if OPAL_HAVE_INLINE_ATOMIC_ADD_64 || (!defined(OPAL_HAVE_ATOMIC_ADD_64) && OPAL_HAVE_ATOMIC_CMPSET_64)
    1.56  static inline
    1.57  #endif
    1.58  int64_t opal_atomic_add_64(volatile int64_t *addr, int64_t delta);
    1.59  
    1.60  /* OPAL_HAVE_INLINE_ATOMIC_*_64 will be 1 if <arch>/atomic.h provides
    1.61 -   a static inline version of it (in assembly).  If it's 0 but
    1.62 -   OPAL_HAVE_ATOMIC_CMPSET_64 is 1, then atomic_impl.h (below) will
    1.63 -   define a static inline version of it (in C, using
    1.64 -   atomic_cmpset_64()).  */
    1.65 -#if OPAL_HAVE_INLINE_ATOMIC_SUB_64 || OPAL_HAVE_ATOMIC_CMPSET_64
    1.66 +   a static inline version of it (in assembly).  If we have to fall
    1.67 +   back to cmpset 64, that too will be inline */
    1.68 +#if OPAL_HAVE_INLINE_ATOMIC_SUB_64 || (!defined(OPAL_HAVE_ATOMIC_ADD_64) && OPAL_HAVE_ATOMIC_CMPSET_64)
    1.69  static inline
    1.70  #endif
    1.71  int64_t opal_atomic_sub_64(volatile int64_t *addr, int64_t delta);
    1.72 @@ -610,12 +602,10 @@
    1.73  #endif /* OPAL_HAVE_ATOMIC_MATH_32 || OPAL_HAVE_ATOMIC_MATH_64 */
    1.74  
    1.75  
    1.76 -/**********************************************************************
    1.77 - *
    1.78 - * Include system specific inline asm definitions. Otherwise
    1.79 - * the definitions are in system specific .s files in src/util.
    1.80 - *
    1.81 - *********************************************************************/
    1.82 +/*
    1.83 + * Include inline implementations of everything not defined directly
    1.84 + * in assembly
    1.85 + */
    1.86  #include "opal/sys/atomic_impl.h"
    1.87  
    1.88  END_C_DECLS