Skip to content

Commit a895bde

Browse files
committed
squashme: Jeff's suggested changes
Signed-off-by: Jeff Squyres <[email protected]>
1 parent 5320468 commit a895bde

File tree

1 file changed

+27
-28
lines changed

1 file changed

+27
-28
lines changed

ompi/include/mpi.h.in

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -310,21 +310,20 @@
310310
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
311311
# define OMPI_REMOVED_USE_STATIC_ASSERT 0
312312
# define __mpi_interface_removed__(func, newfunc) __mpi_interface_deprecated__(#func " was removed in MPI-3.0. Use " #newfunc " instead. continuing...")
313+
# elif (__STDC_VERSION__ >= 201112L)
314+
# define OMPI_OMIT_MPI1_COMPAT_DECLS 1
315+
# define OMPI_REMOVED_USE_STATIC_ASSERT 1
316+
// This macro definition may show up in compiler output. So we both
317+
// outdent it back to column 0 and give it a user-friendly name to
318+
// help users grok what we are trying to tell them here.
319+
#define THIS_SYMBOL_WAS_REMOVED_IN_MPI30(func, newfunc) _Static_assert(0, #func " was removed in MPI-3.0. Use " #newfunc " instead.")
320+
# elif OPAL_HAVE_ATTRIBUTE_ERROR
321+
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
322+
# define OMPI_REMOVED_USE_STATIC_ASSERT 0
323+
# define __mpi_interface_removed__(func, newfunc) __attribute__((__error__(#func " was removed in MPI-3.0. Use " #newfunc " instead.")))
313324
# else
314-
# if (__STDC_VERSION__ >= 201112L)
315-
# define OMPI_OMIT_MPI1_COMPAT_DECLS 1
316-
# define OMPI_REMOVED_USE_STATIC_ASSERT 1
317-
# define OMPI_REMOVED_STATIC_ASSERT_MSG(func, newfunc) _Static_assert(0, #func " was removed in MPI-3.0. Use " #newfunc " instead.")
318-
# else
319-
# if OPAL_HAVE_ATTRIBUTE_ERROR
320-
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
321-
# define OMPI_REMOVED_USE_STATIC_ASSERT 0
322-
# define __mpi_interface_removed__(func, newfunc) __attribute__((__error__(#func " was removed in MPI-3.0. Use " #newfunc " instead.")))
323-
# else
324-
# define OMPI_OMIT_MPI1_COMPAT_DECLS 1
325-
# define OMPI_REMOVED_USE_STATIC_ASSERT 0
326-
# endif
327-
# endif
325+
# define OMPI_OMIT_MPI1_COMPAT_DECLS 1
326+
# define OMPI_REMOVED_USE_STATIC_ASSERT 0
328327
# endif
329328
# endif
330329
#endif
@@ -342,8 +341,8 @@
342341
# define __mpi_interface_removed__(A,B)
343342
#endif
344343

345-
#if !defined(OMPI_REMOVED_STATIC_ASSERT_MSG)
346-
# define OMPI_REMOVED_STATIC_ASSERT_MSG(func, newfunc)
344+
#if !defined(THIS_SYMBOL_WAS_REMOVED_IN_MPI30)
345+
# define THIS_SYMBOL_WAS_REMOVED_IN_MPI30(func, newfunc)
347346
#endif
348347

349348
#if !defined(OMPI_REMOVED_USE_STATIC_ASSERT)
@@ -1081,8 +1080,8 @@ OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub;
10811080
* that staticly assert with a nice message.
10821081
*/
10831082
# if (OMPI_REMOVED_USE_STATIC_ASSERT)
1084-
# define MPI_UB OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_UB, MPI_Type_create_resized);
1085-
# define MPI_LB OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_LB, MPI_Type_create_resized);
1083+
# define MPI_UB THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_UB, MPI_Type_create_resized);
1084+
# define MPI_LB THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_LB, MPI_Type_create_resized);
10861085
# endif /* OMPI_REMOVED_USE_STATIC_ASSERT */
10871086
#endif /* Removed datatypes */
10881087

@@ -2811,16 +2810,16 @@ OMPI_DECLSPEC int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub)
28112810
#endif /* !OMPI_OMIT_MPI1_COMPAT_DECLS */
28122811

28132812
#if OMPI_REMOVED_USE_STATIC_ASSERT
2814-
#define MPI_Address(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Address, MPI_Get_address)
2815-
#define MPI_Errhandler_create(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Errhandler_create, MPI_Comm_create_errhandler)
2816-
#define MPI_Errhandler_get(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Errhandler_get, MPI_Comm_get_errhandler)
2817-
#define MPI_Errhandler_set(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Errhandler_set, MPI_Comm_set_errhandler)
2818-
#define MPI_Type_extent(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_extent, MPI_Type_get_extent)
2819-
#define MPI_Type_hindexed(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_hindexed, MPI_Type_create_hindexed)
2820-
#define MPI_Type_hvector(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_hvector, MPI_Type_create_hvector)
2821-
#define MPI_Type_lb(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_lb, MPI_Type_get_extent)
2822-
#define MPI_Type_struct(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_struct, MPI_Type_create_struct)
2823-
#define MPI_Type_ub(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_ub, MPI_Type_get_extent)
2813+
#define MPI_Address(...) THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_Address, MPI_Get_address)
2814+
#define MPI_Errhandler_create(...) THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_Errhandler_create, MPI_Comm_create_errhandler)
2815+
#define MPI_Errhandler_get(...) THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_Errhandler_get, MPI_Comm_get_errhandler)
2816+
#define MPI_Errhandler_set(...) THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_Errhandler_set, MPI_Comm_set_errhandler)
2817+
#define MPI_Type_extent(...) THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_Type_extent, MPI_Type_get_extent)
2818+
#define MPI_Type_hindexed(...) THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_Type_hindexed, MPI_Type_create_hindexed)
2819+
#define MPI_Type_hvector(...) THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_Type_hvector, MPI_Type_create_hvector)
2820+
#define MPI_Type_lb(...) THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_Type_lb, MPI_Type_get_extent)
2821+
#define MPI_Type_struct(...) THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_Type_struct, MPI_Type_create_struct)
2822+
#define MPI_Type_ub(...) THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_Type_ub, MPI_Type_get_extent)
28242823
#endif
28252824

28262825
#if defined(c_plusplus) || defined(__cplusplus)

0 commit comments

Comments
 (0)