From d55893349fc18e4806a1f400ff0c80d9f73c83fb Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Wed, 30 Nov 2005 03:16:24 +0000 Subject: [PATCH] Convert MPI_Offset to be a typedef instead of a #define. See the following for the rationale: http://www.open-mpi.org/community/lists/users/2005/11/0391.php Note that mpi.h only receives AC_DEFINE's (not AC_SUBST's), so we still have to AC_DEFINE to get the value in there -- so we AC_DEFINE something that we give to a typedef. This commit was SVN r8326. --- configure.ac | 2 +- include/mpi.h.in | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index fb552765e6..326eea8872 100644 --- a/configure.ac +++ b/configure.ac @@ -1278,7 +1278,7 @@ if test "$MPI_OFFSET_TYPE" = "not found"; then AC_MSG_WARN([*** Unable to find the right definition for MPI_Offset]) AC_MSG_ERROR([Cannot continue]) fi -AC_DEFINE_UNQUOTED(MPI_Offset, $MPI_OFFSET_TYPE, [Type of MPI_Offset]) +AC_DEFINE_UNQUOTED(OMPI_MPI_OFFSET_TYPE, $MPI_OFFSET_TYPE, [Type of MPI_Offset -- has to be defined here and typedef'ed later because mpi.h does not get AC SUBST's]) # # If we haven't already, figure out an MPI datatype that corresponds diff --git a/include/mpi.h.in b/include/mpi.h.in index 847aeace4a..d0bb42479f 100644 --- a/include/mpi.h.in +++ b/include/mpi.h.in @@ -67,8 +67,8 @@ /* The size of a `int', as computed by sizeof. */ #undef SIZEOF_INT -/* Type of MPI_Offset */ -#undef MPI_Offset +/* Type of MPI_Offset -- has to be defined here and typedef'ed later because mpi.h does not get AC SUBST's */ +#undef OMPI_MPI_OFFSET_TYPE /* Whether we want MPI cxx support or not */ #undef OMPI_WANT_CXX_BINDINGS @@ -140,6 +140,7 @@ extern "C" { * Typedefs */ typedef long MPI_Aint; +typedef OMPI_MPI_OFFSET_TYPE MPI_Offset; typedef struct ompi_communicator_t *MPI_Comm; typedef struct ompi_datatype_t *MPI_Datatype; typedef struct ompi_errhandler_t *MPI_Errhandler;