From: Arnaud Giersch Date: Fri, 23 Mar 2018 15:58:04 +0000 (+0100) Subject: Forward slash is a valid file separator on Windows too. X-Git-Tag: v3.20~650 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1e5ef63ac93fa2b2a79a1f53866c06e549ecd7d0?hp=82d3a8b124bb809e6a6ea7662dc93abe8f37d07c Forward slash is a valid file separator on Windows too. --- diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 79a3f27c4b..dcb2444df3 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -129,12 +129,6 @@ double surf_get_clock() return NOW; } -#ifdef _WIN32 -# define FILE_DELIM "\\" -#else -# define FILE_DELIM "/" /* FIXME: move to better location */ -#endif - std::ifstream* surf_ifsopen(std::string name) { std::ifstream* fs = new std::ifstream(); @@ -145,7 +139,7 @@ std::ifstream* surf_ifsopen(std::string name) /* search relative files in the path */ for (auto const& path_elm : surf_path) { - std::string buff = path_elm + FILE_DELIM + name; + std::string buff = path_elm + "/" + name; fs->open(buff.c_str(), std::ifstream::in); if (not fs->fail()) { @@ -168,7 +162,7 @@ FILE *surf_fopen(const char *name, const char *mode) /* search relative files in the path */ for (auto const& path_elm : surf_path) { - std::string buff = path_elm + FILE_DELIM + name; + std::string buff = path_elm + "/" + name; file = fopen(buff.c_str(), mode); if (file)