Skip to content

Replace the PMIX_DECLSPEC declaration with PMIX_EXPORT for consistency #4427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Copyright (c) 2009-2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
Expand Down Expand Up @@ -343,26 +343,10 @@
# define __pmix_attribute_destructor__
#endif

#ifndef PMIX_DECLSPEC
# define PMIX_DECLSPEC
#ifdef PMIX_C_HAVE_VISIBILITY
# if PMIX_C_HAVE_VISIBILITY
# define PMIX_EXPORT __attribute__((__visibility__("default")))
# else
# define PMIX_EXPORT
# endif
#else
# define PMIX_EXPORT
#endif
#endif

#ifndef PMIX_DECLSPEC
#define PMIX_DECLSPEC
# if PMIX_C_HAVE_VISIBILITY
#if PMIX_C_HAVE_VISIBILITY
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit: But I would add the redefinition protection before this out of "abundance of caution".

+ #ifndef PMIX_EXPORT
  #if PMIX_C_HAVE_VISIBILITY
  #    define PMIX_EXPORT           __pmix_attribute_visibility__("default")
  #else
  #    define PMIX_EXPORT
  #endif
+ #endif

It's minor enough that I'm not willing to hold up approval for this PR.

# define PMIX_EXPORT __pmix_attribute_visibility__("default")
# else
#else
# define PMIX_EXPORT
# endif
#endif

/*
Expand Down Expand Up @@ -402,11 +386,11 @@ typedef PMIX_PTRDIFF_TYPE ptrdiff_t;
#include <sys/param.h>
#endif
#if defined(PATH_MAX)
#define PMIX_PATH_MAX (PATH_MAX + 1)
#define PMIX_PATH_MAX (PATH_MAX + 1)
#elif defined(_POSIX_PATH_MAX)
#define PMIX_PATH_MAX (_POSIX_PATH_MAX + 1)
#define PMIX_PATH_MAX (_POSIX_PATH_MAX + 1)
#else
#define PMIX_PATH_MAX 256
#define PMIX_PATH_MAX 256
#endif

#if defined(MAXHOSTNAMELEN)
Expand Down Expand Up @@ -590,4 +574,3 @@ typedef PMIX_PTRDIFF_TYPE ptrdiff_t;

#endif /* PMIX_BUILDING */
#endif /* PMIX_CONFIG_BOTTOM_H */

16 changes: 8 additions & 8 deletions opal/mca/pmix/pmix112/pmix/src/buffer_ops/buffer_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc.
Expand Down Expand Up @@ -44,12 +44,12 @@ BEGIN_C_DECLS
* of places throughout the code base - transferring a value to
* another pmix_value_t structure
*/
PMIX_DECLSPEC pmix_status_t pmix_value_xfer(pmix_value_t *kv, pmix_value_t *src);
PMIX_DECLSPEC void pmix_value_load(pmix_value_t *v, void *data,
PMIX_EXPORT pmix_status_t pmix_value_xfer(pmix_value_t *kv, pmix_value_t *src);
PMIX_EXPORT void pmix_value_load(pmix_value_t *v, void *data,
pmix_data_type_t type);
PMIX_DECLSPEC pmix_status_t pmix_value_unload(pmix_value_t *kv, void **data,
PMIX_EXPORT pmix_status_t pmix_value_unload(pmix_value_t *kv, void **data,
size_t *sz, pmix_data_type_t type);
PMIX_DECLSPEC bool pmix_value_cmp(pmix_value_t *p, pmix_value_t *p1);
PMIX_EXPORT bool pmix_value_cmp(pmix_value_t *p, pmix_value_t *p1);


#define PMIX_LOAD_BUFFER(b, d, s) \
Expand Down Expand Up @@ -247,12 +247,12 @@ typedef pmix_status_t (*pmix_bfrop_copy_payload_fn_t)(pmix_buffer_t *dest,
* structure gets loaded, so we provide an "open" call that is
* executed as part of the program startup.
*/
PMIX_DECLSPEC pmix_status_t pmix_bfrop_open(void);
PMIX_EXPORT pmix_status_t pmix_bfrop_open(void);

/**
* BFROP finalize function
*/
PMIX_DECLSPEC pmix_status_t pmix_bfrop_close(void);
PMIX_EXPORT pmix_status_t pmix_bfrop_close(void);


/**
Expand Down Expand Up @@ -308,7 +308,7 @@ struct pmix_bfrop_t {
};
typedef struct pmix_bfrop_t pmix_bfrop_t;

PMIX_DECLSPEC extern pmix_bfrop_t pmix_bfrop; /* holds bfrop function pointers */
PMIX_EXPORT extern pmix_bfrop_t pmix_bfrop; /* holds bfrop function pointers */

END_C_DECLS

Expand Down
8 changes: 4 additions & 4 deletions opal/mca/pmix/pmix112/pmix/src/buffer_ops/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved.
Expand Down Expand Up @@ -189,7 +189,7 @@ typedef struct {
/** print function */
pmix_bfrop_print_fn_t odti_print_fn;
} pmix_bfrop_type_info_t;
PMIX_DECLSPEC PMIX_CLASS_DECLARATION(pmix_bfrop_type_info_t);
PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_bfrop_type_info_t);

/*
* globals needed within bfrop
Expand Down Expand Up @@ -235,10 +235,10 @@ extern pmix_data_type_t pmix_bfrop_num_reg_types;
/*
* Specialized functions
*/
PMIX_DECLSPEC pmix_status_t pmix_bfrop_pack_buffer(pmix_buffer_t *buffer, const void *src,
PMIX_EXPORT pmix_status_t pmix_bfrop_pack_buffer(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);

PMIX_DECLSPEC pmix_status_t pmix_bfrop_unpack_buffer(pmix_buffer_t *buffer, void *dst,
PMIX_EXPORT pmix_status_t pmix_bfrop_unpack_buffer(pmix_buffer_t *buffer, void *dst,
int32_t *num_vals, pmix_data_type_t type);

/*
Expand Down
8 changes: 4 additions & 4 deletions opal/mca/pmix/pmix112/pmix/src/buffer_ops/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* All rights reserved.
* Copyright (c) 2007-2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -78,7 +78,7 @@ typedef struct {
including overhead -- packed in the buffer) */
size_t bytes_used;
} pmix_buffer_t;
PMIX_DECLSPEC PMIX_CLASS_DECLARATION (pmix_buffer_t);
PMIX_EXPORT PMIX_CLASS_DECLARATION (pmix_buffer_t);

/* these classes are required by the regex code shared
* between the client and server implementations - it
Expand All @@ -88,7 +88,7 @@ typedef struct {
int start;
int cnt;
} pmix_regex_range_t;
PMIX_DECLSPEC PMIX_CLASS_DECLARATION(pmix_regex_range_t);
PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_regex_range_t);

typedef struct {
/* list object */
Expand All @@ -98,7 +98,7 @@ typedef struct {
int num_digits;
pmix_list_t ranges;
} pmix_regex_value_t;
PMIX_DECLSPEC PMIX_CLASS_DECLARATION(pmix_regex_value_t);
PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_regex_value_t);

END_C_DECLS

Expand Down
54 changes: 27 additions & 27 deletions opal/mca/pmix/pmix112/pmix/src/class/pmix_hash_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc.
Expand Down Expand Up @@ -47,7 +47,7 @@

BEGIN_C_DECLS

PMIX_DECLSPEC PMIX_CLASS_DECLARATION(pmix_hash_table_t);
PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_hash_table_t);

struct pmix_hash_table_t
{
Expand All @@ -73,12 +73,12 @@ typedef struct pmix_hash_table_t pmix_hash_table_t;
*
*/

PMIX_DECLSPEC pmix_status_t pmix_hash_table_init(pmix_hash_table_t* ht, size_t table_size);
PMIX_EXPORT pmix_status_t pmix_hash_table_init(pmix_hash_table_t* ht, size_t table_size);

/**
* Alternative form
*/
PMIX_DECLSPEC pmix_status_t pmix_hash_table_init2(pmix_hash_table_t* ht, size_t estimated_max_size,
PMIX_EXPORT pmix_status_t pmix_hash_table_init2(pmix_hash_table_t* ht, size_t estimated_max_size,
int density_numer, int density_denom,
int growth_numer, int growth_denom);

Expand All @@ -103,7 +103,7 @@ static inline size_t pmix_hash_table_get_size(pmix_hash_table_t *ht)
*
*/

PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_all(pmix_hash_table_t *ht);
PMIX_EXPORT pmix_status_t pmix_hash_table_remove_all(pmix_hash_table_t *ht);

/**
* Retrieve value via uint32_t key.
Expand All @@ -118,8 +118,8 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_all(pmix_hash_table_t *ht);
*
*/

PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_value_uint32(pmix_hash_table_t* table, uint32_t key,
void** ptr);
PMIX_EXPORT pmix_status_t pmix_hash_table_get_value_uint32(pmix_hash_table_t* table, uint32_t key,
void** ptr);

/**
* Set value based on uint32_t key.
Expand All @@ -131,7 +131,7 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_value_uint32(pmix_hash_table_t*
*
*/

PMIX_DECLSPEC pmix_status_t pmix_hash_table_set_value_uint32(pmix_hash_table_t* table, uint32_t key, void* value);
PMIX_EXPORT pmix_status_t pmix_hash_table_set_value_uint32(pmix_hash_table_t* table, uint32_t key, void* value);

/**
* Remove value based on uint32_t key.
Expand All @@ -142,7 +142,7 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_set_value_uint32(pmix_hash_table_t*
*
*/

PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_value_uint32(pmix_hash_table_t* table, uint32_t key);
PMIX_EXPORT pmix_status_t pmix_hash_table_remove_value_uint32(pmix_hash_table_t* table, uint32_t key);

/**
* Retrieve value via uint64_t key.
Expand All @@ -157,8 +157,8 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_value_uint32(pmix_hash_table_
*
*/

PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_value_uint64(pmix_hash_table_t *table, uint64_t key,
void **ptr);
PMIX_EXPORT pmix_status_t pmix_hash_table_get_value_uint64(pmix_hash_table_t *table, uint64_t key,
void **ptr);

/**
* Set value based on uint64_t key.
Expand All @@ -170,7 +170,7 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_value_uint64(pmix_hash_table_t *
*
*/

PMIX_DECLSPEC pmix_status_t pmix_hash_table_set_value_uint64(pmix_hash_table_t *table, uint64_t key, void* value);
PMIX_EXPORT pmix_status_t pmix_hash_table_set_value_uint64(pmix_hash_table_t *table, uint64_t key, void* value);

/**
* Remove value based on uint64_t key.
Expand All @@ -181,7 +181,7 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_set_value_uint64(pmix_hash_table_t *
*
*/

PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_value_uint64(pmix_hash_table_t *table, uint64_t key);
PMIX_EXPORT pmix_status_t pmix_hash_table_remove_value_uint64(pmix_hash_table_t *table, uint64_t key);

/**
* Retrieve value via arbitrary length binary key.
Expand All @@ -196,8 +196,8 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_value_uint64(pmix_hash_table_
*
*/

PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_value_ptr(pmix_hash_table_t *table, const void* key,
size_t keylen, void **ptr);
PMIX_EXPORT pmix_status_t pmix_hash_table_get_value_ptr(pmix_hash_table_t *table, const void* key,
size_t keylen, void **ptr);

/**
* Set value based on arbitrary length binary key.
Expand All @@ -209,7 +209,7 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_value_ptr(pmix_hash_table_t *tab
*
*/

PMIX_DECLSPEC pmix_status_t pmix_hash_table_set_value_ptr(pmix_hash_table_t *table, const void* key, size_t keylen, void* value);
PMIX_EXPORT pmix_status_t pmix_hash_table_set_value_ptr(pmix_hash_table_t *table, const void* key, size_t keylen, void* value);

/**
* Remove value based on arbitrary length binary key.
Expand All @@ -220,7 +220,7 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_set_value_ptr(pmix_hash_table_t *tab
*
*/

PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_value_ptr(pmix_hash_table_t *table, const void* key, size_t keylen);
PMIX_EXPORT pmix_status_t pmix_hash_table_remove_value_ptr(pmix_hash_table_t *table, const void* key, size_t keylen);


/** The following functions are only for allowing iterating through
Expand All @@ -245,8 +245,8 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_remove_value_ptr(pmix_hash_table_t *
*
*/

PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_first_key_uint32(pmix_hash_table_t *table, uint32_t *key,
void **value, void **node);
PMIX_EXPORT pmix_status_t pmix_hash_table_get_first_key_uint32(pmix_hash_table_t *table, uint32_t *key,
void **value, void **node);


/**
Expand All @@ -263,9 +263,9 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_first_key_uint32(pmix_hash_table
*
*/

PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_next_key_uint32(pmix_hash_table_t *table, uint32_t *key,
void **value, void *in_node,
void **out_node);
PMIX_EXPORT pmix_status_t pmix_hash_table_get_next_key_uint32(pmix_hash_table_t *table, uint32_t *key,
void **value, void *in_node,
void **out_node);


/**
Expand All @@ -281,8 +281,8 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_next_key_uint32(pmix_hash_table_
*
*/

PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_first_key_uint64(pmix_hash_table_t *table, uint64_t *key,
void **value, void **node);
PMIX_EXPORT pmix_status_t pmix_hash_table_get_first_key_uint64(pmix_hash_table_t *table, uint64_t *key,
void **value, void **node);


/**
Expand All @@ -299,9 +299,9 @@ PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_first_key_uint64(pmix_hash_table
*
*/

PMIX_DECLSPEC pmix_status_t pmix_hash_table_get_next_key_uint64(pmix_hash_table_t *table, uint64_t *key,
void **value, void *in_node,
void **out_node);
PMIX_EXPORT pmix_status_t pmix_hash_table_get_next_key_uint64(pmix_hash_table_t *table, uint64_t *key,
void **value, void *in_node,
void **out_node);

/**
* @brief Returns next power-of-two of the given value.
Expand Down
Loading