|
310 | 310 | # define OMPI_OMIT_MPI1_COMPAT_DECLS 0
|
311 | 311 | # define OMPI_REMOVED_USE_STATIC_ASSERT 0
|
312 | 312 | # 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."))) |
313 | 324 | # 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 |
328 | 327 | # endif
|
329 | 328 | # endif
|
330 | 329 | #endif
|
|
342 | 341 | # define __mpi_interface_removed__(A,B)
|
343 | 342 | #endif
|
344 | 343 |
|
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) |
347 | 346 | #endif
|
348 | 347 |
|
349 | 348 | #if !defined(OMPI_REMOVED_USE_STATIC_ASSERT)
|
@@ -1081,8 +1080,8 @@ OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub;
|
1081 | 1080 | * that staticly assert with a nice message.
|
1082 | 1081 | */
|
1083 | 1082 | # 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); |
1086 | 1085 | # endif /* OMPI_REMOVED_USE_STATIC_ASSERT */
|
1087 | 1086 | #endif /* Removed datatypes */
|
1088 | 1087 |
|
@@ -2811,16 +2810,16 @@ OMPI_DECLSPEC int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub)
|
2811 | 2810 | #endif /* !OMPI_OMIT_MPI1_COMPAT_DECLS */
|
2812 | 2811 |
|
2813 | 2812 | #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) |
2824 | 2823 | #endif
|
2825 | 2824 |
|
2826 | 2825 | #if defined(c_plusplus) || defined(__cplusplus)
|
|
0 commit comments