diff --git a/opal/class/opal_atomic_lifo.h b/opal/class/opal_atomic_lifo.h index 25aa26fbc3..4bdfb7baac 100644 --- a/opal/class/opal_atomic_lifo.h +++ b/opal/class/opal_atomic_lifo.h @@ -27,11 +27,9 @@ #include "opal/sys/atomic.h" #endif /* OMPI_HAVE_THREAD_SUPPORT */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS - /* Atomic Last In First Out lists. If we are in a multi-threaded environment then the +/* Atomic Last In First Out lists. If we are in a multi-threaded environment then the * atomicity is insured via the compare-and-swap operation, if not we simply do a read * and/or a write. * @@ -51,6 +49,7 @@ typedef struct opal_atomic_lifo_t opal_atomic_lifo_t; OPAL_DECLSPEC OBJ_CLASS_DECLARATION(opal_atomic_lifo_t); + /* The ghost pointer will never change. The head will change via an atomic * compare-and-swap. On most architectures the reading of a pointer is an * atomic operation so we don't have to protect it. @@ -60,6 +59,7 @@ static inline bool opal_atomic_lifo_is_empty( opal_atomic_lifo_t* lifo ) return (lifo->opal_lifo_head == &(lifo->opal_lifo_ghost) ? true : false); } + /* Add one element to the LIFO. We will return the last head of the list * to allow the upper level to detect if this element is the first one in the * list (if the list was empty before this operation). @@ -112,9 +112,7 @@ static inline opal_list_item_t* opal_atomic_lifo_pop( opal_atomic_lifo_t* lifo ) return item; } -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS #endif /* OPAL_ATOMIC_LIFO_H_HAS_BEEN_INCLUDED */ diff --git a/opal/class/opal_free_list.h b/opal/class/opal_free_list.h index 49b50648fa..8f07efb544 100644 --- a/opal/class/opal_free_list.h +++ b/opal/class/opal_free_list.h @@ -27,9 +27,7 @@ #include "opal/constants.h" #include "opal/prefetch.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS struct opal_free_list_t { @@ -124,7 +122,6 @@ OPAL_DECLSPEC int opal_free_list_grow(opal_free_list_t* flist, size_t num_elemen * been reached. In this case the caller is blocked until an item * is returned to the list. */ - #define OPAL_FREE_LIST_WAIT(fl, item, rc) \ do { \ @@ -161,8 +158,7 @@ OPAL_DECLSPEC int opal_free_list_grow(opal_free_list_t* flist, size_t num_elemen OPAL_THREAD_UNLOCK(&(fl)->fl_lock); \ } while(0) -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS + #endif diff --git a/opal/class/opal_hash_table.h b/opal/class/opal_hash_table.h index b5b4064733..08c5695fb3 100644 --- a/opal/class/opal_hash_table.h +++ b/opal/class/opal_hash_table.h @@ -31,9 +31,7 @@ #include "opal_config.h" #include "opal/class/opal_list.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS OPAL_DECLSPEC OBJ_CLASS_DECLARATION(opal_hash_table_t); @@ -285,10 +283,6 @@ OPAL_DECLSPEC int opal_hash_table_get_next_key_uint64(opal_hash_table_t *table, void **value, void *in_node, void **out_node); - -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif - +END_C_DECLS #endif /* OPAL_HASH_TABLE_H */ diff --git a/opal/class/opal_list.h b/opal/class/opal_list.h index 36a493a5db..5b79224369 100644 --- a/opal/class/opal_list.h +++ b/opal/class/opal_list.h @@ -74,9 +74,8 @@ #include "opal/threads/mutex.h" #endif -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS + /** * \internal * @@ -798,10 +797,6 @@ static inline void opal_list_insert_pos(opal_list_t *list, opal_list_item_t *pos */ OPAL_DECLSPEC int opal_list_sort(opal_list_t* list, opal_list_item_compare_fn_t compare); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif - - +END_C_DECLS #endif /* OPAL_LIST_H */ diff --git a/opal/class/opal_object.h b/opal/class/opal_object.h index 27d8467fc4..2d01a4c686 100644 --- a/opal/class/opal_object.h +++ b/opal/class/opal_object.h @@ -126,6 +126,8 @@ #include "opal/sys/atomic.h" #endif /* OMPI_HAVE_THREAD_SUPPORT */ +BEGIN_C_DECLS + #if OMPI_ENABLE_DEBUG /* Any kind of unique ID should do the job */ #define OPAL_OBJ_MAGIC_ID ((0xdeafbeedULL << 32) + 0xdeafbeedULL) @@ -501,7 +503,7 @@ static inline int opal_obj_update(opal_object_t *object, int inc) #endif } +END_C_DECLS -/**********************************************************************/ +#endif -#endif /* OPAL_OBJECT_H */ diff --git a/opal/class/opal_value_array.h b/opal/class/opal_value_array.h index 7667c8f4e6..364d36915e 100644 --- a/opal/class/opal_value_array.h +++ b/opal/class/opal_value_array.h @@ -29,12 +29,11 @@ #endif #include "opal/constants.h" +BEGIN_C_DECLS + /* * @file Array of elements maintained by value. */ -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif struct opal_value_array_t { @@ -272,9 +271,7 @@ static inline int opal_value_array_remove_item(opal_value_array_t *array, size_t #define OPAL_VALUE_ARRAY_GET_BASE(array, item_type) \ ((item_type*) ((array)->array_items)) -#if defined(c_plusplus) || defined(__cplusplus) -} +END_C_DECLS + #endif -#endif -