From b3a98bab009b8b5c599cb58507d851513764fe2d Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Wed, 14 Jul 2004 15:13:32 +0000 Subject: [PATCH] Add some protection for redefining malloc/realloc/free -- we do not want to do this in the C++ MPI bindings. This commit was SVN r1713. --- include/ompi_config_bottom.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/include/ompi_config_bottom.h b/include/ompi_config_bottom.h index 06449e1cce..eedcb31921 100644 --- a/include/ompi_config_bottom.h +++ b/include/ompi_config_bottom.h @@ -53,8 +53,20 @@ extern bool ompi_mpi_param_check; /* * Do we want memory debugging? + * + * A few scenarios: + * + * 1. In the OMPI C library: we want these defines in all cases + * 2. In the OMPI C++ bindings: we do not want them + * 3. In the OMPI C++ executables: we do want them + * + * So for 1, everyone must include first. For 2, the + * C++ bindings will never include -- they will only + * include , which includes , but after + * OMPI_MPI_H is defined. For 3, it's the same as 1 -- just include + * first. */ -#if OMPI_ENABLE_MEM_DEBUG && defined(OMPI_BUILDING) && OMPI_BUILDING +#if OMPI_ENABLE_MEM_DEBUG && defined(OMPI_BUILDING) && OMPI_BUILDING && !defined(OMPI_MPI_H) /* It is safe to include util/malloc.h here because a) it will only happen when we are building OMPI and therefore have a full OMPI