Skip to content

Commit

Permalink
patchup for reverting a commit
Browse files Browse the repository at this point in the history
Signed-off-by: Howard Pritchard <[email protected]>
  • Loading branch information
hppritcha committed Apr 19, 2022
1 parent f2c32e2 commit 55d69d1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ompi/mpi/fortran/base/fint_2_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@
#define OMPI_SINGLE_FINT_2_INT(in)
#define OMPI_SINGLE_INT_2_FINT(in)
#define OMPI_ARRAY_INT_2_FINT(in, n)
#define OMPI_COND_STATEMENT(a)

#elif OMPI_SIZEOF_FORTRAN_INTEGER > SIZEOF_INT
#define OMPI_ARRAY_NAME_DECL(a) int *c_##a
#define OMPI_ARRAY_NAME_DECL(a) int *c_##a = NULL
#define OMPI_2_DIM_ARRAY_NAME_DECL(a, dim2) int (*c_##a)[dim2], dim2_index
#define OMPI_SINGLE_NAME_DECL(a) int c_##a
#define OMPI_ARRAY_NAME_CONVERT(a) c_##a
Expand Down Expand Up @@ -86,7 +87,8 @@

/* This is for IN parameters. Does only free */
#define OMPI_ARRAY_FINT_2_INT_CLEANUP(in) \
free(OMPI_ARRAY_NAME_CONVERT(in))
if (NULL != OMPI_ARRAY_NAME_CONVERT(in)) \
free(OMPI_ARRAY_NAME_CONVERT(in))

/* This is for single IN parameter */
#define OMPI_SINGLE_FINT_2_INT(in) \
Expand All @@ -105,8 +107,10 @@
} \
free(OMPI_ARRAY_NAME_CONVERT(in)); \
} while (0)

#define OMPI_COND_STATEMENT(a) a
#else /* int > MPI_Fint */
#define OMPI_ARRAY_NAME_DECL(a) int *c_##a
#define OMPI_ARRAY_NAME_DECL(a) int *c_##a = NULL
#define OMPI_2_DIM_ARRAY_NAME_DECL(a, dim2) int (*c_##a)[dim2], dim2_index
#define OMPI_SINGLE_NAME_DECL(a) int c_##a
#define OMPI_ARRAY_NAME_CONVERT(a) c_##a
Expand Down Expand Up @@ -140,7 +144,8 @@
} while (0)

#define OMPI_ARRAY_FINT_2_INT_CLEANUP(in) \
free(OMPI_ARRAY_NAME_CONVERT(in))
if (NULL != OMPI_ARRAY_NAME_CONVERT(in)) \
free(OMPI_ARRAY_NAME_CONVERT(in))

#define OMPI_SINGLE_FINT_2_INT(in) \
OMPI_ARRAY_NAME_CONVERT(in) = *(in)
Expand All @@ -157,6 +162,7 @@
free(OMPI_ARRAY_NAME_CONVERT(in)); \
} while (0)

#define OMPI_COND_STATEMENT(a) a
#endif

/*
Expand Down

0 comments on commit 55d69d1

Please sign in to comment.