From: Martin Quinson Date: Tue, 8 Jan 2019 07:51:01 +0000 (+0100) Subject: s/HAVE_SENDFILE/SG_HAVE_SENDFILE/ X-Git-Tag: v3_22~646 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/4b9e8701e4d7cb2a6a8b577af830c96f3d303f86 s/HAVE_SENDFILE/SG_HAVE_SENDFILE/ Now that the python-bindings load the private headers too (to get Context::StopRequest() in Context.hpp), we get some naming conflict. Interestingly, that's only visible on some architectures, not globally. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index f934f2fbbd..3e90c9a34f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -327,9 +327,9 @@ endif() CHECK_INCLUDE_FILE("sys/sendfile.h" HAVE_SENDFILE_H) CHECK_FUNCTION_EXISTS(sendfile HAVE_SENDFILE) if(HAVE_SENDFILE_H AND HAVE_SENDFILE) - set(HAVE_SENDFILE 1) + set(SG_HAVE_SENDFILE 1) else() - set(HAVE_SENDFILE 0) + set(SG_HAVE_SENDFILE 0) endif() if(enable_model-checking AND NOT "${CMAKE_SYSTEM}" MATCHES "Linux|FreeBSD") diff --git a/src/internal_config.h.in b/src/internal_config.h.in index 795d3893d8..c32f594fb8 100644 --- a/src/internal_config.h.in +++ b/src/internal_config.h.in @@ -77,7 +77,7 @@ /* We have PAPI to fine-grain trace execution time */ #cmakedefine01 HAVE_PAPI /* We have sendfile to efficiently copy files for dl-open privatization */ -#cmakedefine01 HAVE_SENDFILE +#cmakedefine01 SG_HAVE_SENDFILE /* Other function checks */ /* Function dlfunc */ diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 92e4e750d0..c337d3e9d5 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -37,7 +37,7 @@ # define HAVE_WORKING_MMAP 1 #endif -#if HAVE_SENDFILE +#if SG_HAVE_SENDFILE #include #endif @@ -498,7 +498,7 @@ static void smpi_copy_file(std::string src, std::string target, off_t fdin_size) XBT_DEBUG("Copy %" PRIdMAX " bytes into %s", static_cast(fdin_size), target.c_str()); bool slow_copy = true; -#if HAVE_SENDFILE +#if SG_HAVE_SENDFILE ssize_t sent_size = sendfile(fdout, fdin, NULL, fdin_size); if (sent_size == fdin_size) slow_copy = false;