diff --git a/ompi/include/mpi.h.in b/ompi/include/mpi.h.in index 4168e6fcb79..841256613ef 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -19,7 +19,7 @@ * Copyright (c) 2015 University of Houston. All rights reserved. * Copyright (c) 2015-2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2017-2018 IBM Corporation. All rights reserved. + * Copyright (c) 2017-2019 IBM Corporation. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -279,10 +279,20 @@ # define __mpi_interface_deprecated__(msg) __attribute__((__deprecated__)) # endif # endif -# if (OMPI_ENABLE_MPI1_COMPAT && !OMPI_BUILDING) -# define __mpi_interface_removed__(msg) __mpi_interface_deprecated__(msg) -# define OMPI_OMIT_MPI1_COMPAT_DECLS 0 +# endif +# if (!OMPI_ENABLE_MPI1_COMPAT && !OMPI_BUILDING) +# if OPAL_HAVE_ATTRIBUTE_ERROR +# define __mpi_interface_removed__(msg) __attribute__((__error__(msg))) +# else +# if (__STDC_VERSION__ >= 201101L) +# define __mpi_interface_removed__(msg) _Static_assert(0,msg) +# endif # endif +# else + /* If configured with --enable-mpi1-compatibility, emit + * warning with the deprecated function attribute instead. + */ +# define __mpi_interface_removed__(msg) __mpi_interface_deprecated__(msg) # endif # endif #endif @@ -1003,8 +1013,9 @@ OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUSES_IGNORE; #if (!OMPI_OMIT_MPI1_COMPAT_DECLS || OMPI_BUILDING) /* - * Removed datatypes. These datatypes are only available if Open MPI - * was configured with --enable-mpi1-compatibility. + * Removed datatypes. These datatypes _SHOULD_ only be available + * if Open MPI was configured with --enable-mpi1-compatibility, + * however they * * These datatypes were formally removed from the MPI specification * and should no longer be used in MPI applications. @@ -1012,10 +1023,8 @@ OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUSES_IGNORE; #define MPI_UB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_ub) #define MPI_LB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_lb) -OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_lb - __mpi_interface_removed__("MPI_LB was removed in MPI-3.0; use MPI_Type_create_resized instead."); -OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub - __mpi_interface_removed__("MPI_UB was removed in MPI-3.0; use MPI_Type_create_resized instead."); +OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_lb; +OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub; #endif /* !OMPI_OMIT_MPI1_COMPAT_DECLS */ /* @@ -2739,7 +2748,7 @@ OMPI_DECLSPEC int MPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub) __mpi_interface_removed__("MPI_Type_ub has been removed in MPI-3.0; use MPI_Type_get_extent instead."); OMPI_DECLSPEC int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub) __mpi_interface_removed__("PMPI_Type_ub has been removed in MPI-3.0; use PMPI_Type_get_extent instead."); -#endif /* !OMPI_OMIT_MPI1_COMPAT_DECLS */ +#endif #if defined(c_plusplus) || defined(__cplusplus) }