X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5bd175db106a40f35d99c26bb77276b29343646d..bf2eac918e4a2b27667268c0f4355f0797fd5af4:/include/smpi/sampi.h diff --git a/include/smpi/sampi.h b/include/smpi/sampi.h index a8923b1ab0..9290d99839 100644 --- a/include/smpi/sampi.h +++ b/include/smpi/sampi.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -6,6 +6,7 @@ #ifndef SAMPI_H_ #define SAMPI_H_ +#define SMPI_NO_OVERRIDE_MALLOC #include #include @@ -14,14 +15,17 @@ type _XBT_CONCAT(AP, name) args; #ifndef HAVE_SMPI +#undef malloc +#undef calloc +#undef free // Internally disable these overrides (HAVE_SMPI is only defined when building the library) #define malloc(nbytes) _sampi_malloc(nbytes) -#define calloc(n_elm,elm_size) _sampi_calloc(n_elm,elm_size) -#define realloc(ptr,nbytes) _sampi_realloc(ptr,nbytes) +#define calloc(n_elm, elm_size) _sampi_calloc((n_elm), (elm_size)) +#define realloc(ptr, nbytes) _sampi_realloc((ptr), (nbytes)) #define free(ptr) _sampi_free(ptr) #endif -SG_BEGIN_DECL() +SG_BEGIN_DECL XBT_PUBLIC void* _sampi_malloc(size_t size); XBT_PUBLIC void* _sampi_calloc(size_t n_elm, size_t elm_size); @@ -32,6 +36,6 @@ AMPI_CALL(XBT_PUBLIC int, MPI_Iteration_in, (MPI_Comm comm)) AMPI_CALL(XBT_PUBLIC int, MPI_Iteration_out, (MPI_Comm comm)) AMPI_CALL(XBT_PUBLIC void, MPI_Migrate, (MPI_Comm comm)) -SG_END_DECL() +SG_END_DECL #endif