Skip to content

Commit 400857e

Browse files
committed
mpi.h: Be consistent in compat macro usage
Be consistent in using OMPI_OMIT_MPI1_COMPAT_DECLS when deciding whether or not to declare removed types/functions/etc. and remove the inconsistent sprinkling of OMPI_BUILDING checks by setting OMPI_OMIT_MPI1_COMPAT_DECLS based on the OMPI_BUILDING value. Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent 3dd091e commit 400857e

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

ompi/include/mpi.h.in

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
*/
333333
# if defined(OMPI_OMIT_MPI1_COMPAT_DECLS)
334334
/* The user set OMPI_OMIT_MPI1_COMPAT_DECLS, do what he commands */
335-
# elif (OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING)
335+
# elif OMPI_ENABLE_MPI1_COMPAT
336336
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
337337
# define OMPI_REMOVED_USE_STATIC_ASSERT 0
338338
# define __mpi_interface_removed__(func, newfunc) __mpi_interface_deprecated__(#func " was removed in MPI-3.0. Use " #newfunc " instead. continuing...")
@@ -394,7 +394,7 @@
394394
#endif
395395

396396
#if !defined(OMPI_OMIT_MPI1_COMPAT_DECLS)
397-
# define OMPI_OMIT_MPI1_COMPAT_DECLS !OMPI_ENABLE_MPI1_COMPAT
397+
# define OMPI_OMIT_MPI1_COMPAT_DECLS (!(OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING))
398398
#endif
399399

400400
/*
@@ -767,21 +767,21 @@ enum {
767767
MPI_COMBINER_DUP,
768768
MPI_COMBINER_CONTIGUOUS,
769769
MPI_COMBINER_VECTOR,
770-
#if (OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING)
770+
#if (!OMPI_OMIT_MPI1_COMPAT_DECLS)
771771
MPI_COMBINER_HVECTOR_INTEGER,
772772
#else
773773
OMPI_WAS_MPI_COMBINER_HVECTOR_INTEGER, /* preserve ABI compatibility */
774774
#endif
775775
MPI_COMBINER_HVECTOR,
776776
MPI_COMBINER_INDEXED,
777-
#if (OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING)
777+
#if (!OMPI_OMIT_MPI1_COMPAT_DECLS)
778778
MPI_COMBINER_HINDEXED_INTEGER,
779779
#else
780780
OMPI_WAS_MPI_COMBINER_HINDEXED_INTEGER, /* preserve ABI compatibility */
781781
#endif
782782
MPI_COMBINER_HINDEXED,
783783
MPI_COMBINER_INDEXED_BLOCK,
784-
#if (OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING)
784+
#if (!OMPI_OMIT_MPI1_COMPAT_DECLS)
785785
MPI_COMBINER_STRUCT_INTEGER,
786786
#else
787787
OMPI_WAS_MPI_COMBINER_STRUCT_INTEGER, /* preserve ABI compatibility */
@@ -796,8 +796,7 @@ enum {
796796
MPI_COMBINER_HINDEXED_BLOCK
797797
};
798798

799-
#if (OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING)
800-
#else
799+
#if (OMPI_OMIT_MPI1_COMPAT_DECLS)
801800
/* If not building or configured --enable-mpi1-compatibility, then
802801
* we don't want these datatypes, instead we define MPI_COMBINER_*_INTEGER
803802
* to our Static Assert message if the compiler supports
@@ -1167,7 +1166,7 @@ OMPI_DECLSPEC extern MPI_Fint *MPI_F08_STATUSES_IGNORE;
11671166
* These datatypes were formally removed from the MPI specification
11681167
* and should no longer be used in MPI applications.
11691168
*/
1170-
#if (OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING)
1169+
#if (!OMPI_OMIT_MPI1_COMPAT_DECLS)
11711170
# define MPI_UB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_ub)
11721171
# define MPI_LB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_lb)
11731172

@@ -3043,7 +3042,7 @@ OMPI_DECLSPEC int OMPI_C_MPI_NULL_DELETE_FN( MPI_Comm comm, int comm_keyval,
30433042
void* extra_state )
30443043
__mpi_interface_deprecated__("MPI_NULL_DELETE_FN was deprecated in MPI-2.0; use MPI_COMM_NULL_DELETE_FN instead.");
30453044

3046-
#if (!OMPI_OMIT_MPI1_COMPAT_DECLS || OMPI_BUILDING)
3045+
#if (!OMPI_OMIT_MPI1_COMPAT_DECLS)
30473046
/*
30483047
* Removed typedefs. These typedefs are only available if Open MPI
30493048
* was configured with --enable-mpi1-compatibility.

0 commit comments

Comments
 (0)