From: Arnaud Giersch Date: Thu, 24 Mar 2011 15:04:25 +0000 (+0100) Subject: Preparation for the removal of THROW1 in SG/svn. X-Git-Tag: v0.1~75 X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/commitdiff_plain/fdbf720097c9e51eef43f0c9811ab5899789349a Preparation for the removal of THROW1 in SG/svn. --- diff --git a/TODO b/TODO index d59eb3c..bee25a1 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,5 @@ +* When ready, remove hack for THROWF in main.cpp. + * Support heterogeneous platforms? Not sure yet. Should be doable if each process also sends its speed to its neighbors. diff --git a/main.cpp b/main.cpp index 76125e9..c2b1d18 100644 --- a/main.cpp +++ b/main.cpp @@ -6,6 +6,12 @@ #include #include +// Don't look at this dirty hack... +// Delete it when THROWF comes in SG/svn. +#ifndef THROWF +#define THROWF(...) THROW1(__VA_ARGS__) +#endif + // Creates log categories XBT_LOG_NEW_CATEGORY(simu, "Root of simulation messages"); XBT_LOG_NEW_SUBCATEGORY(main, simu, "Messages from global infrastructure"); @@ -98,10 +104,10 @@ static int simulation_main(int argc, char* argv[]) delete proc; } catch (const std::invalid_argument& e) { - THROW1(arg_error, 0, "%s", e.what()); + THROWF(arg_error, 0, "%s", e.what()); } catch (const std::exception& e) { - THROW1(0, 0, "%s", e.what()); + THROWF(0, 0, "%s", e.what()); } return result; } @@ -255,7 +261,7 @@ int main(int argc, char* argv[]) delete proc_mutex; if (res != MSG_OK) - THROW1(0, 0, "MSG_main() failed with status %#x", res); + THROWF(0, 0, "MSG_main() failed with status %#x", res); exit_status = EXIT_NO_FAILURE; // ===== }